Exemple #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);
        }
Exemple #2
0
 private void RemoveAcceptor(Detail.Acceptor acceptor)
 {
     rwLock.EnterWriteLock();
     acceptors.Remove(acceptor);
     rwLock.ExitWriteLock();
 }
Exemple #3
0
 private void AddAcceptor(Detail.Acceptor acceptor)
 {
     rwLock.EnterWriteLock();
     acceptors.Add(acceptor, true);
     rwLock.ExitWriteLock();
 }
Exemple #4
0
 internal void OnAccepted(Detail.Acceptor acceptor, Socket socket)
 {
     OnNewSocket(socket, true);
 }