コード例 #1
0
ファイル: Gate.cs プロジェクト: AllenWangxiao/GateSharp
        public Gate()
        {
            frontendNetwork = new ServerNetwork(6888)
            {
                OnClientConnected = OnFrontendConnected,
                OnClientMessageReceived = OnFrontendMessageReceived,
            };
            backendNetwork = new ServerNetwork(6999)
            {
                OnClientConnected = OnBackendConnected,
                OnClientMessageReceived = OnBackendMessageReceived,
            };

            frontendNetwork.BeginAccept();
            backendNetwork.BeginAccept();
        }
コード例 #2
0
ファイル: Gate.cs プロジェクト: fingerpasswang/GateSharp
        public Gate(int frontPort, int backPort)
        {
            frontendNetwork = new ServerNetwork(frontPort)
            {
                OnClientConnected = OnFrontendConnected,
                OnClientDisconnected = OnFrontendDisconnected,
                OnClientMessageReceived = OnFrontendMessageReceived,
            };
            backendNetwork = new ServerNetwork(backPort)
            {
                OnClientConnected = OnBackendConnected,
                OnClientDisconnected = OnBackendDisconnected,
                OnClientMessageReceived = OnBackendMessageReceived,
            };

            frontendNetwork.BeginAccept();
            backendNetwork.BeginAccept();
        }