public void Listen(System.Net.IPAddress address, int port, int backlog) { _listener = new ConnectionListener (_eventBase, new System.Net.IPEndPoint (address, port), (short)backlog); _listener.ConnectionAccepted += SocketAccepted; _listener.Disable (); new Thread (EventLoop).Start (); }
public void Listen(System.Net.IPAddress address, int port, int backlog) { _listener = new ConnectionListener(_eventBase, new System.Net.IPEndPoint(address, port), (short)backlog); _listener.ConnectionAccepted += SocketAccepted; _listener.Disable(); new Thread(EventLoop).Start(); }
public void SetUp() { connectedEndpoint = null; eventBase = new EventBase(); listener = new ConnectionListener(eventBase, TestEndPoint, TestBacklog); listener.ConnectionAccepted = ConnectionAccepted; client = new TcpClient(); }
public void SetUp() { eventBase = new EventBase(); listener = new ConnectionListener(eventBase, EVConnListenerTests.TestEndPoint, EVConnListenerTests.TestBacklog); listener.ConnectionAccepted = ConnectionAccepted; client = new TcpClient(); readData = new MemoryStream(); }
public IDisposable Listen(IPEndPoint ep) { if (listening) throw new InvalidOperationException("Already listening."); ListenEndPoint = ep; listener = new ConnectionListener(eventBase, ep, 1000); listener.Enable(); listener.ConnectionAccepted = (fd, remoteEp) => { connections++; var ev = new Event(eventBase, fd, Events.EV_WRITE | Events.EV_READ); //if (OnConnection != null) // OnConnection(this, new ConnectionEventArgs(new OarsSocket(ev, remoteEp, this))); }; listening = true; closed = false; // XXX return Disposable(() => Close()); return null; }
public void Dispose() { listener.Dispose(); listener = null; }