public TcpServer(long handle, long port, Tcp.Protocol protocol) { _handle = handle; _protocol = protocol; _ip = new IPEndPoint(IPAddress.Any, (int)port); _listener = new Socket(_ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp); _clients = new Dictionary <long, TcpServerSession> (); _requests = new Dictionary <long, TcpServerSession> (); _inbox = new TcpListenBox(); }
public TcpServerSession(RCAsyncState state, TcpServer server, Socket socket, TcpListenBox inbox, long handle) { _listenState = state; _server = server; _socket = socket; _handle = handle; _buffer = new TcpMessageBuffer(); // One outbox per *session* _outbox = new TcpOutBox(); // One inbox per *server* _inbox = inbox; }