code: public OtpMsg receiveMsg() throws IOException, OtpErlangExit,
              OtpAuthException {
          final Object o = queue.get();
  
          if (o instanceof OtpMsg) {
              return (OtpMsg) o;
          } else if (o instanceof IOException) {
              throw (IOException) o;
          } else if (o instanceof OtpErlangExit) {
              throw (OtpErlangExit) o;
          } else if (o instanceof OtpAuthException) {
              throw (OtpAuthException) o;
          }
  
          return null;
      }
docs: Receive a messge complete with sender and recipient information.
  
  @return an {@link OtpMsg OtpMsg} containing the header information about
  the sender and recipient, as well as the actual message contents.
  
  @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, or if the connection is lost for any reason.
  
  @exception OtpAuthException
  if the remote node sends a message containing an invalid
  cookie.