code: def recv(sock, size):
      
      data = sock.recv(size, socket.MSG_WAITALL)
      if len(data) < size:
          raise socket.error(ECONNRESET, 'Connection closed')
      return data
docs: Receives exactly `size` bytes.  This function blocks the thread.