protected virtual Task OnSubscriberDisconnected(ZOTCPServer tcpServer, TcpClient tcpClient) { // BUGBUG: if multiple subscribers connected IsSubscribersConnected can be still true // TODO: Fixme IsSubscribersConnected = false; return(Task.CompletedTask); }
/// <summary> /// Starts the message publisher as an Async task /// </summary> /// <returns>Task</returns> public async Task RunAsync() { _tcpServer = new ZOTCPServer() { IPAddress = IPAddress, Port = Port, OnConnectedDelegate = OnSubscriberConnected, OnConnectionClosedDelegate = OnSubscriberDisconnected }; await _tcpServer.RunAsync(); }
protected virtual Task OnPublisherConnected(ZOTCPServer tcpServer, TcpClient tcpClient) { return(Task.CompletedTask); }
/// <summary> /// /// Dummy OnSubscriberDisconnected delegate for ZOTCPServer /// </summary> /// <param name="tcpServer"></param> /// <param name="tcpClient"></param> /// <returns></returns> protected virtual Task OnSubscriberDisconnected(ZOTCPServer tcpServer, TcpClient tcpClient) { return(Task.CompletedTask); }
protected virtual Task OnSubscriberConnected(ZOTCPServer tcpServer, TcpClient tcpClient) { IsSubscribersConnected = true; return(Task.CompletedTask); }