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 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); } }