public void onMsg( MamaSubscription subscription, MamaMsg msg) { mamaMsgType msgType = msg.typeForMsg(); mamaMsgStatus msgStatus = msg.getStatus(); switch (msgType) { case mamaMsgType.MAMA_MSG_TYPE_DELETE: case mamaMsgType.MAMA_MSG_TYPE_EXPIRE: subscription.deallocate(); return; } switch (msgStatus) { case mamaMsgStatus.MAMA_MSG_STATUS_BAD_SYMBOL: case mamaMsgStatus.MAMA_MSG_STATUS_EXPIRED: case mamaMsgStatus.MAMA_MSG_STATUS_TIMEOUT: subscription.deallocate(); return; } for (int i=0;i<mSubscription.mMsgListeners.Count;i++) { MamdaMsgListener listener = (MamdaMsgListener) mSubscription.mMsgListeners[i]; listener.onMsg(mSubscription, msg, msgType); } }