code: public OtpErlangObject receive() throws IOException, OtpErlangExit,
              OtpAuthException {
          try {
              return receiveMsg().getMsg();
          } catch (final OtpErlangDecodeException e) {
              close();
              throw new IOException(e.getMessage());
          }
      }
docs: Receive a message from a remote process. This method blocks until a valid
  message is received or an exception is raised.
  
  <p>
  If the remote node sends a message that cannot be decoded properly, the
  connection is closed and the method throws an exception.
  
  @return an object containing a single Erlang term.
  
  @exception java.io.IOException
  if the connection is not active or a communication error
  occurs.
  
  @exception OtpErlangExit
  if an exit signal is received from a process on the peer
  node.
  
  @exception OtpAuthException
  if the remote node sends a message containing an invalid
  cookie.