I can think of two possible explanations:
The
sendMsg(...)
call may be happening too late; e.g. after streams have been closed or flushed.The
sendMsg(...)
call may be throwing an exception. Uncaught exceptions thrown in a shutdown hook typically don't get reported.
If you showed us the code of sendMsg
we might be able to figure out a more definite answer.