code: public OtpMsg receiveMsg() throws OtpErlangExit {
  
          final OtpMsg m = (OtpMsg) queue.get();
  
          switch (m.type()) {
          case OtpMsg.exitTag:
          case OtpMsg.exit2Tag:
              try {
                  final OtpErlangObject o = m.getMsg();
                  throw new OtpErlangExit(o, m.getSenderPid());
              } catch (final OtpErlangDecodeException e) {
                  throw new OtpErlangExit("unknown", m.getSenderPid());
              }
  
          default:
              return m;
          }
      }
docs: Block until a message arrives for this mailbox.
  
  @return an {@link OtpMsg OtpMsg} containing the header information as
  well as the body of the next message waiting in this mailbox.
  
  @exception OtpErlangExit
  if a linked {@link OtpErlangPid pid} has exited or has
  sent an exit signal to this mailbox.