TsgcWSConnection is a wrapper for client WebSocket connections. You can access this object in Server or Client Events.
WriteData: sends a message to the client.
Close: sends a close message to other peer. A "CloseCode" can be specified optionally. By default, the value sent is NORMAL close code. If you send a negative close code, the reason for closing will not be sent.
Disconnect: close client connection from the server side. A "CloseCode" can be specified optionally.
Ping: sends a ping to the client.
AddTCPEndOfFrame: if connection is plain TCP, allows you to set which byte/s define the end of message. Message is buffered till is received completely.
Subscribed: returns if the connection is subscribed to a custom channel.
Subscribe: subscribe this connection to a channel. Later you can Broadcast a message from server component to all connections subscribed to this channel.
UnSubscribe: unsubscribe this connection from a channel.
Protocol: returns sub-protocol used on this connection.
IP: returns Peer IP Address.
Port: returns Peer Port.
LocalIP: returns Host IP Address.
LocalPort: returns Host Port.
URL: returns URL requested by the client.
Guid: returns connection ID.
HeadersRequest: returns a list of Headers received on Request.
HeadersResponse: returns a list of Headers sent as Response.
RecBytes: number of bytes received.
SendBytes: number of bytes sent.
Transport: returns the transport type of connection:
trpRFC6455: a normal WebSocket connection.
trpHixie76: a WebSocket connection using draft WebSocket spec.
trpFlash: a WebSocket connection using Flash as FallBack.
trpSSE: a Server-Sent Events connection.
trpTCP: plain TCP connection.
TCPEndOfFrameScanBuffer: allows defining which method use to find end of message (if using trpTCP as transport).
eofScanNone: every time a new packet arrives, the OnBinary event is called.
eofScanLatestBytes: if latest bytes are equal to bytes added with AddTCPEndOfFrame method, OnBinary message is called, otherwise this packet is buffered
eofScanAllBytes: searches in the entire packet for bytes equal to bytes added with the AddTCPEndOfFrame method. If found, the OnBinary event is called, otherwise this packet is buffered
Data: user session data object, here you can pass an object and access this every time you need, for example: you can pass a connection to a database, user session properties...