Пример #1
0
        public void AcceptCallback(SelectServerSharedBuffer server, Socket listenSock)
        {
            Socket newSocket = listenSock.Accept();
            RpcServerConnectionHandler connection = new RpcServerConnectionHandler(this, newSocket);

            server.AddReceiveSocket(newSocket, connection.HandleData);
        }
Пример #2
0
        public void AcceptCallback(SelectServerSharedBuffer server, Socket listenSock)
        {
            Socket newSock = listenSock.Accept();

            DebugClientData clientData = new DebugClientData(newSock);

            server.AddReceiveSocket(newSock, clientData.DataCallback);
            clientData.SendPrompt();
        }
Пример #3
0
        static void AddRpcServer(SelectServerSharedBuffer selectServer, EndPoint endPoint, RpcServerHandler handler, int backlog)
        {
            Socket tcpAcceptSocket = new Socket(endPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            tcpAcceptSocket.Bind(endPoint);
            tcpAcceptSocket.Listen(backlog);
            selectServer.AddListenSocket(tcpAcceptSocket, handler.AcceptCallback);

            Socket udpSocket = new Socket(endPoint.AddressFamily, SocketType.Dgram, ProtocolType.Udp);

            udpSocket.Bind(endPoint);
            selectServer.AddReceiveSocket(udpSocket, handler.DatagramRecvHandler);
        }