protected virtual void BeginDataReceive(ProxySocket socket) { if (this.socket == null || !this.socket.Connected) { return; } receiveBuf.Initialize(); socket.BeginReceive(receiveBuf, 0, receiveBuf.Length, SocketFlags.None, new AsyncCallback(EndDataReceive), socket); }
protected virtual void BeginDataReceive(ProxySocket socket) { if (this.socket == null || !this.socket.Connected) { return; } receiveBuf = new ByteBuffer(); socket.BeginReceive(receiveBuf.ByteArray, 0, receiveBuf.ByteArray.Length, SocketFlags.None, new AsyncCallback(EndDataReceive), socket); }
private void BeginReceiveLength() { Socket.BeginReceive(RecvBuffer, ReceivedLength, 4 - ReceivedLength, SocketFlags.None, ReceiveLengthCallback, null); }