public virtual OtpMsg receiveMsg()
{
OtpMsg m = (OtpMsg)queue.get();
switch (m.type())
{
case OtpMsg.exitTag:
case OtpMsg.exit2Tag:
try
{
OtpErlangObject o = m.getMsg();
throw new OtpErlangExit(o, m.getSenderPid());
}
catch (OtpErlangDecodeException)
{
throw new OtpErlangExit("unknown", m.getSenderPid());
}
default:
return m;
}
}