private void handler_Closed(FtpSocketHandler handler) { m_apConnections.Remove(handler); if (ConnectionClosed != null) { ConnectionClosed(handler.Id); } }
private void Handler_Closed(FtpSocketHandler handler) { m_apConnections.Remove(handler); numberOfConnections = m_apConnections.Count; Trace.WriteLine($"Remover a handler, current connection number is {numberOfConnections}", "Information"); ConnectionClosed?.Invoke(handler.Id); }
private void handler_Closed(FtpSocketHandler handler) { m_apConnections.Remove(handler); Trace.WriteLine( string.Format("Remover a handler, current connection number is {0}", m_apConnections.Count), "Information"); if (ConnectionClosed != null) { ConnectionClosed(handler.Id); } }
private void handler_Closed(FtpSocketHandler handler) { m_apConnections.Remove(handler); Trace.WriteLine( string.Format("Handler closed {0}. Current Count {1}", handler.Socket.Client.RemoteEndPoint.ToString(), m_apConnections.Count), "Information"); if (ConnectionClosed != null) { ConnectionClosed(handler.Id); } }
private void InitialiseSocketHandler(TcpClient socket) { var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId); handler.Start(socket); m_apConnections.Add(handler); handler.Closed += handler_Closed; if (NewConnection != null) { NewConnection(m_nId); } }
private void handler_Closed(FtpSocketHandler handler) { lock (m_apConnections) { m_apConnections.Remove(handler); LogWrite( $"Client closed: {handler.RemoteEndPoint} current count={m_apConnections.Count}"); Trace.WriteLine( $"Handler closed {handler.RemoteEndPoint}. Current Count {m_apConnections.Count}", "Information"); ConnectionClosed?.Invoke(handler.Id); } }
private void InitialiseSocketHandler(TcpClient socket) { var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId); handler.UserLoginEvent += UserLoginEvent; handler.UserLogoutEvent += UserLogoutEvent; // get encoding for the socket connection handler.Start(socket, m_encoding); m_apConnections.Add(handler); numberOfConnections = m_apConnections.Count; Trace.WriteLine($"Add a new handler, current connection number is {numberOfConnections}", "Information"); handler.Closed += Handler_Closed; NewConnection?.Invoke(m_nId); }
private void InitialiseSocketHandler(TcpClient socket) { var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId); // get encoding for the socket connection handler.Start(socket, m_encoding); m_apConnections.Add(handler); Trace.WriteLine( string.Format("Add a new handler, current connection number is {0}", m_apConnections.Count), "Information"); handler.Closed += handler_Closed; if (NewConnection != null) { NewConnection(m_nId); } }
private void InitialiseSocketHandler(TcpClient socket) { var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId); // get encoding for the socket connection handler.Start(socket, m_encoding); m_apConnections.Add(handler); Trace.WriteLine( string.Format("Handler created for client {0}. Current Count {1}", socket.Client.RemoteEndPoint.ToString(), m_apConnections.Count), "Information"); handler.Closed += handler_Closed; if (NewConnection != null) { NewConnection(m_nId); } }
private void InitialiseSocketHandler(TcpClient socket) { lock (m_apConnections) { var handler = new FtpSocketHandler(m_fileSystemClassFactory, m_nId); handler.Closed += handler_Closed; // get encoding for the socket connection handler.Start(socket, m_encoding); m_apConnections.Add(handler); FtpServer.LogWrite( $"Client accepted: {socket.Client.RemoteEndPoint} current count={m_apConnections.Count}"); Trace.WriteLine( $"Handler created for client {handler.RemoteEndPoint}. Current Count {m_apConnections.Count}", "Information"); NewConnection?.Invoke(m_nId); } }
private void InitialiseSocketHandler(TcpClient socket) { var handler = new FtpSocketHandler( fileSystemClassFactory: m_fileSystemClassFactory, nId: m_nId, localPasvEndpoint: this.m_localPasvEndpoint, externallyVisiblePasvEndpoint: this.m_externallyVisiblePasvEndpoint, maxIdleTime: this.m_maxIdleTime); // get encoding for the socket connection handler.Start(socket, m_encoding); m_apConnections.Add(handler); Trace.WriteLine( string.Format("Add a new handler, current connection number is {0}", m_apConnections.Count), "Information"); handler.Closed += handler_Closed; if (NewConnection != null) { NewConnection(m_nId); } }