private TciClient(string serverIpAddress, uint serverPort, CancellationToken cancellationToken) { _messageHandler = new TciMessageHandler(); _messageHandler.OnSocketConnectionChanged += MessageHandler_OnSocketConnectionChanged; TransceiverController = new TransceiverController(_messageHandler, this); _tciWebSocketClient = TciWebSocketClient.CreateAsync(serverIpAddress, serverPort, cancellationToken).Result; Initialize(); }
public void OnMessage(string message, TciWebSocketClient tciWebSocketClient) { if (_tciWebSocketClient != tciWebSocketClient) { return; } OnSocketMessageReceived?.Invoke(this, new TciMessageReceivedEventArgs(message: message)); }
public void OnDisConnect(TciWebSocketClient tciWebSocketClient) { if (_tciWebSocketClient != tciWebSocketClient) { return; } OnSocketConnectionChanged?.Invoke(this, new TciConnectedEventArgs(false)); }
public void OnConnect(TciWebSocketClient tciWebSocketClient) { _tciWebSocketClient = tciWebSocketClient; OnSocketConnectionChanged?.Invoke(this, new TciConnectedEventArgs(true)); }