Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        /// <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);
 }
Esempio n. 4
0
 /// <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);
 }
Esempio n. 5
0
 protected virtual Task OnSubscriberConnected(ZOTCPServer tcpServer, TcpClient tcpClient)
 {
     IsSubscribersConnected = true;
     return(Task.CompletedTask);
 }