Beispiel #1
0
        public Result Listen(IPAddress ip, ushort port)
        {
            var acceptor = new Detail.Acceptor(ip, port);

            var result = acceptor.BeginAccept();

            if (result)
            {
                AddAcceptor(acceptor);
            }

            return(result);
        }
Beispiel #2
0
 private void RemoveAcceptor(Detail.Acceptor acceptor)
 {
     rwLock.EnterWriteLock();
     acceptors.Remove(acceptor);
     rwLock.ExitWriteLock();
 }
Beispiel #3
0
 private void AddAcceptor(Detail.Acceptor acceptor)
 {
     rwLock.EnterWriteLock();
     acceptors.Add(acceptor, true);
     rwLock.ExitWriteLock();
 }
Beispiel #4
0
 internal void OnAccepted(Detail.Acceptor acceptor, Socket socket)
 {
     OnNewSocket(socket, true);
 }