public BaseListener(IPAddress address, int port, BaseListener.ClientArrivedHandler handler) { _port = port; ClientArrived += handler; _tcpListener = new TcpListener(address, _port); _tcpListener.Start(); _acceptorThread = new GThread(new ThreadStart(_acceptorloop), "Acceptor Loop", true); _acceptorThread.Start(); }
public BaseListener(int port, BaseListener.ClientArrivedHandler handler = null) { _port = port; if (handler != null) { ClientArrived += handler; } _tcpListener = new TcpListener(_port); _tcpListener.Start(); _acceptorThread = new GThread(new ThreadStart(_acceptorloop), "Acceptor Loop", true); _acceptorThread.Start(); }