WebSocket Type

This class represents a WebSocket connection, it provides an interface to read and write to a WebSocket.

Constructors

Constructor Description

WebSocket(connection, subprotocol)

Full Usage: WebSocket(connection, subprotocol)

Parameters:
    connection : Connection
    subprotocol : string option

Returns: WebSocket
connection : Connection
subprotocol : string option
Returns: WebSocket

Instance members

Instance member Description

this.read ()

Full Usage: this.read ()

Returns: SocketOp<Opcode * ByteSegment * bool>
Returns: SocketOp<Opcode * ByteSegment * bool>

this.readIntoByteSegment byteSegmentForLengthFunc

Full Usage: this.readIntoByteSegment byteSegmentForLengthFunc

Parameters:
Returns: SocketOp<Opcode * ByteSegment * bool>

Reads from the websocket and puts the data into a ByteSegment selected by the byteSegmentForLengthFunc parameter A function that takes in the message length in bytes required to hold the next websocket message and returns an appropriately sized ArraySegment of bytes

byteSegmentForLengthFunc : int -> ByteSegment
Returns: SocketOp<Opcode * ByteSegment * bool>

this.send opcode bs fin

Full Usage: this.send opcode bs fin

Parameters:
Returns: SocketOp<unit>
opcode : Opcode
bs : ByteSegment
fin : bool
Returns: SocketOp<unit>

this.subprotocol

Full Usage: this.subprotocol

Returns: string option
Returns: string option