예제 #1
0
 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 ();
 }
예제 #2
0
 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();
 }
예제 #3
0
 public void SetUp()
 {
     connectedEndpoint = null;
     eventBase = new EventBase();
     listener = new ConnectionListener(eventBase, TestEndPoint, TestBacklog);
     listener.ConnectionAccepted = ConnectionAccepted;
     client = new TcpClient();
 }
예제 #4
0
 public void SetUp()
 {
     eventBase = new EventBase();
     listener = new ConnectionListener(eventBase, EVConnListenerTests.TestEndPoint, EVConnListenerTests.TestBacklog);
     listener.ConnectionAccepted = ConnectionAccepted;
     client = new TcpClient();
     readData = new MemoryStream();
 }
예제 #5
0
파일: OarsServer.cs 프로젝트: ruxo/kayak
        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;
        }
예제 #6
0
파일: OarsServer.cs 프로젝트: ruxo/kayak
 public void Dispose()
 {
     listener.Dispose();
     listener = null;
 }