protected void triggerOnReceive(ReceiveVO receiveVO, int bytesReceived) { if (OnReceive != null) { OnReceive(this, new ReceiveEventArgs(receiveVO.socket, trimmedBuffer(receiveVO.buffer, bytesReceived))); } }
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); }