WebSocket Module

Types

Type Description

ByteSegmentCapacityException

CloseCode

Frame

FrameHeader

Opcode

WebSocket

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

Functions and values

Function or value Description

chooseSubprotocol subprotocol requestSubprotocols ctx

Full Usage: chooseSubprotocol subprotocol requestSubprotocols ctx

Parameters:
    subprotocol : string
    requestSubprotocols : string[]
    ctx : HttpContext

Returns: Async<string option>
subprotocol : string
requestSubprotocols : string[]
ctx : HttpContext
Returns: Async<string option>

fork f

Full Usage: fork f

Parameters:
    f : obj -> unit

f : obj -> unit

fromOpcode _arg1

Full Usage: fromOpcode _arg1

Parameters:
Returns: byte
_arg1 : Opcode
Returns: byte

handShake continuation ctx

Full Usage: handShake continuation ctx

Parameters:
Returns: Async<HttpContext option>
continuation : WebSocket -> HttpContext -> SocketOp<unit>
ctx : HttpContext
Returns: Async<HttpContext option>

handShakeResponse handShakeToken

Full Usage: handShakeResponse handShakeToken

Parameters:
    handShakeToken : string

Returns: HttpContext -> Async<HttpContext option>
handShakeToken : string
Returns: HttpContext -> Async<HttpContext option>

handShakeTask continuation ctx

Full Usage: handShakeTask continuation ctx

Parameters:
Returns: Task<HttpContext option>

The handShake combinator captures a WebSocket and pass it to the provided `continuation`

continuation : WebSocket -> HttpContext -> SocketOp<unit>
ctx : HttpContext
Returns: Task<HttpContext option>

handShakeWithSubprotocol choose continuation ctx

Full Usage: handShakeWithSubprotocol choose continuation ctx

Parameters:
Returns: Async<HttpContext option>

The handShakeWithSubprotocol combinator captures a WebSocket and pass it to the provided `continuation`

choose : string[] -> HttpContext -> Async<string option>
continuation : WebSocket -> HttpContext -> SocketOp<unit>
ctx : HttpContext
Returns: Async<HttpContext option>

handShakeWithSubprotocolResponse subprotocol handShakeToken

Full Usage: handShakeWithSubprotocolResponse subprotocol handShakeToken

Parameters:
    subprotocol : string
    handShakeToken : string

Returns: HttpContext -> Async<HttpContext option>
subprotocol : string
handShakeToken : string
Returns: HttpContext -> Async<HttpContext option>

magicGUID

Full Usage: magicGUID

Returns: string
Returns: string

readBytes connection n

Full Usage: readBytes connection n

Parameters:
Returns: SocketOp<byte[]>
connection : Connection
n : int
Returns: SocketOp<byte[]>

readBytesIntoByteSegment retrieveByteSegment connection n

Full Usage: readBytesIntoByteSegment retrieveByteSegment connection n

Parameters:
Returns: SocketOp<ByteSegment>
retrieveByteSegment : int -> ByteSegment
connection : Connection
n : int
Returns: SocketOp<ByteSegment>

toOpcode _arg1

Full Usage: toOpcode _arg1

Parameters:
    _arg1 : byte

Returns: Opcode
_arg1 : byte
Returns: Opcode

validateConnectionHeader header

Full Usage: validateConnectionHeader header

Parameters:
    header : Choice<string, string>

Returns: bool
header : Choice<string, string>
Returns: bool

validateHandShake ctx

Full Usage: validateHandShake ctx

Parameters:
Returns: Choice<string, Async<HttpContext option>>
ctx : HttpContext
Returns: Choice<string, Async<HttpContext option>>

writeFrame connection f

Full Usage: writeFrame connection f

Parameters:
Returns: SocketOp<unit>
connection : Connection
f : Frame
Returns: SocketOp<unit>