protected void StartReceiving(Socket socket) { var receiveVO = new ReceiveVO { socket = socket, buffer = new byte[socket.ReceiveBufferSize] }; Receive(receiveVO); }
protected void Receive(ReceiveVO receiveVO) { receiveVO.socket.BeginReceive(receiveVO.buffer, 0, receiveVO.buffer.Length, SocketFlags.None, OnReceived, receiveVO); }
protected void TriggerOnReceive(ReceiveVO receiveVO, int bytesReceived) { OnReceive?.Invoke(this, new ReceiveEventArgs(receiveVO.socket, TrimmedBuffer(receiveVO.buffer, bytesReceived))); }