Esempio n. 1
0
        public void Start()
        {
            TCPSetting serverSetting = TestDefine.GetTCPSetting();

            server = new TCPServer(serverSetting);
            server.onConnectionConnect += OnAccepted;
            server.onConnectionDropped += OnConnectionDropped;
            server.onReceiveCallback   += OnRevecie;
            server.Listen();
        }
Esempio n. 2
0
        public void Start()
        {
            TCPSetting clientSetting = TestDefine.GetTCPSetting();

            client = new TCPClient(clientSetting);
            client.onConnectCallback       += OnConnected;
            client.onConnectFailedCallback += OnConnectedFail;
            client.onClosedCallback        += OnCloseCallback;
            client.onReceiveCallback       += OnRevecie;
            client.Connect();
        }