コード例 #1
0
        public TClient(Socket socket, TServer server)
            : base(server, ClientType.Accept)
        {
            this.socket             = socket;
            this.socket.NoDelay     = true;
            this.parser             = new PacketParser(this.recvBuffer);
            this.innArgs.Completed += this.OnComplete;
            this.outArgs.Completed += this.OnComplete;

            this.RemoteAddress = (IPEndPoint)socket.RemoteEndPoint;
            this.isConnected   = true;
            this.isSending     = false;
        }
コード例 #2
0
        public TClient(IPEndPoint ipEndPoint, TServer server)
            : base(server, ClientType.Connect)
        {
            this.socket             = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            this.socket.NoDelay     = true;
            this.parser             = new PacketParser(this.recvBuffer);
            this.innArgs.Completed += this.OnComplete;
            this.outArgs.Completed += this.OnComplete;

            this.RemoteAddress = ipEndPoint;
            this.isConnected   = false;
            this.isSending     = false;
        }