Logo FSBarV1_Archived

Connection Module

Functions and values

Function or value Description

acceptConnection listener timeoutMs readTimeoutMs

Full Usage: acceptConnection listener timeoutMs readTimeoutMs

Parameters:
    listener : Socket
    timeoutMs : int
    readTimeoutMs : int

Returns: Socket * NetworkStream

Accept a single connection from the listener within the given timeout (ms). Returns the accepted client socket and a NetworkStream wrapping it.

listener : Socket
timeoutMs : int
readTimeoutMs : int
Returns: Socket * NetworkStream

cleanup socketPath arg2

Full Usage: cleanup socketPath arg2

Parameters:
    socketPath : string
    arg1 : Socket option

Clean up the socket and remove the socket file from disk.

socketPath : string
arg1 : Socket option

createListener socketPath

Full Usage: createListener socketPath

Parameters:
    socketPath : string

Returns: Socket

Create a Unix domain socket listener bound to the given path. Removes any stale socket file before binding.

socketPath : string
Returns: Socket

recvBytes stream

Full Usage: recvBytes stream

Parameters:
Returns: byte[]

Receive a length-prefixed frame and return the raw payload bytes. Reads a 4-byte little-endian length header, then reads that many bytes.

stream : NetworkStream
Returns: byte[]

sendMessage stream data

Full Usage: sendMessage stream data

Parameters:

Send a protobuf-serialized message as a length-prefixed frame: 4-byte little-endian length header followed by the payload bytes.

stream : NetworkStream
data : byte[]

Type something to start searching.