static void AddRpcServer(SelectServer selectServer, EndPoint endPoint, RpcServerHandler handler, int backlog) { Socket tcpAcceptSocket = new Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp); tcpAcceptSocket.Bind(endPoint); tcpAcceptSocket.Listen(backlog); selectServer.control.AddListenSocket(tcpAcceptSocket, handler.AcceptCallback); Socket udpSocket = new Socket(endPoint.AddressFamily, SocketType.Dgram, ProtocolType.Udp); udpSocket.Bind(endPoint); selectServer.control.AddReceiveSocket(udpSocket, handler.DatagramRecvHandler); }
public RpcServerConnectionHandler(RpcServerHandler server, Socket socket) { this.server = server; this.socket = socket; this.recordBuilder = new RecordBuilder(socket.SafeRemoteEndPointString(), server.HandleTcpRecord); }