public Result Listen(IPAddress ip, ushort port) { var acceptor = new Detail.Acceptor(ip, port); var result = acceptor.BeginAccept(); if (result) { AddAcceptor(acceptor); } return(result); }
private void RemoveAcceptor(Detail.Acceptor acceptor) { rwLock.EnterWriteLock(); acceptors.Remove(acceptor); rwLock.ExitWriteLock(); }
private void AddAcceptor(Detail.Acceptor acceptor) { rwLock.EnterWriteLock(); acceptors.Add(acceptor, true); rwLock.ExitWriteLock(); }
internal void OnAccepted(Detail.Acceptor acceptor, Socket socket) { OnNewSocket(socket, true); }