By Admin on Monday, 01 September 2025
Category: All

Using WebSocket Client in .NET

TsgcWebSocketClient is the .NET wrapper around the sgcWebSockets runtime client. It inherits all core WebSocket capabilities from TsgcWebSocketClient_base, giving .NET applications a component-style API for connecting, sending, and receiving over WebSockets  

Key Properties

Events

Register event handlers to react to connection lifecycle and data:

Example

This snippet mirrors the demo usage: events are wired up before connecting, key properties are configured (host, port, TLS, RFC6455, etc.), and setting Active to true initiates the connection.

With the event handlers defined (as shown above), the client can log connections, receive messages, and send data through WriteData

Related Posts