示例#1
0
 public void Remove_closed_socket()
 {
     using (Udt.SocketPoller poller = new Udt.SocketPoller())
     {
         Udt.Socket socket = new Udt.Socket(AddressFamily.InterNetwork, SocketType.Stream);
         poller.AddSocket(socket);
         socket.Dispose();
         poller.RemoveSocket(socket);
     }
 }
示例#2
0
 public void Remove_closed_socket()
 {
     using (Udt.SocketPoller poller = new Udt.SocketPoller())
     {
         Udt.Socket socket = new Udt.Socket(AddressFamily.InterNetwork, SocketType.Stream);
         poller.AddSocket(socket);
         socket.Dispose();
         poller.RemoveSocket(socket);
     }
 }
示例#3
0
        public void Remove_socket()
        {
            using (Udt.SocketPoller poller = new Udt.SocketPoller())
                using (Udt.Socket socket = new Udt.Socket(AddressFamily.InterNetwork, SocketType.Stream))
                {
                    socket.Bind(IPAddress.Loopback, 0);
                    socket.Listen(100);
                    ManualResetEvent doneEvent = new ManualResetEvent(false);

                    poller.AddSocket(socket);
                    Assert.IsFalse(poller.Wait(TimeSpan.Zero));
                    poller.RemoveSocket(socket);

                    Assert.Throws <InvalidOperationException>(() => poller.Wait(TimeSpan.Zero));
                }
        }
示例#4
0
        public void Remove_socket()
        {
            using (Udt.SocketPoller poller = new Udt.SocketPoller())
            using (Udt.Socket socket = new Udt.Socket(AddressFamily.InterNetwork, SocketType.Stream))
            {
                socket.Bind(IPAddress.Loopback, 0);
                socket.Listen(100);
                ManualResetEvent doneEvent = new ManualResetEvent(false);

                poller.AddSocket(socket);
                Assert.IsFalse(poller.Wait(TimeSpan.Zero));
                poller.RemoveSocket(socket);

                Assert.Throws<InvalidOperationException>(() => poller.Wait(TimeSpan.Zero));
            }
        }