/// <summary> /// Initializes a new instance of the class. /// </summary> public WinsockServerActuatorBase() { _socketServer = null; }
/// <summary> /// Initializes the socket server object and subscribes to events /// </summary> private void initSocketInterface() { if (ServerListenPort > 0) { _socketServer = new SocketServer(ServerListenPort); _socketServer.OnPacketReceived += _socketServer_OnPacketReceived; _socketServer.OnClientConnected += _socketServer_OnClientConnected; _socketServer.OnClientDisconnected += _socketServer_OnClientDisconnected; _socketServer.Start(); } else { Log.Debug("Listen error. Listen port not set"); } }
/// <summary> /// Uninitialize. Stop socket server /// </summary> /// <returns>true</returns> private void unInit() { if (_socketServer != null) { _socketServer.Stop(); _socketServer = null; } }