Esempio n. 1
0
        public NetServerClient(ushort id, TcpClient tcpClient)
        {
            _id = id;

            // Also store endpoint with TCP address and TCP port
            _endPoint = (IPEndPoint)tcpClient.Client.RemoteEndPoint;

            _tcpNetClient = new TcpNetClient();
            _tcpNetClient.InitializeWithClient(tcpClient);
            _tcpNetClient.RegisterOnReceive(OnReceiveData);
        }
Esempio n. 2
0
        public NetServerClient(ushort id, TcpClient tcpClient, UdpClient udpClient)
        {
            _id = id;

            // Also store endpoint with TCP address and TCP port
            _endPoint = (IPEndPoint)tcpClient.Client.RemoteEndPoint;

            _tcpNetClient = new TcpNetClient();
            _tcpNetClient.InitializeWithClient(tcpClient);

            UpdateManager = new ServerUpdateManager(udpClient, _endPoint);
        }