uudashr/jsmpp

Receiver thread(PDUReaderWorker) can stop without any log or recovery when some invalid packet is received via the session.

sinihong opened this issue · 0 comments

It is totally abnormal case, but when some invalid packet is received by receiver(PDUReaderWorker), it could just stop without closing session and even leaving any log, because 'IndexOutOfBoundsException' could occur in reading the invalid packet but it catches only three checked exceptions. (InvalidCommandLengthException, SocketTimeoutException and IOException).

For example, if 0x0000 is received by the receiver, DefautPDUReader will throw 'IndexOutOfBoundException' in 'readPDUHeader' because the packet has just incorrect message length value. And as a result, the receiver will just stop without handling or logging it.
In the case, no reconnect will be triggered and enquire link will remain locked until another error occurs for sending message and reconnect is triggered.

PDUReaderWorker will need to catch unchecked exceptions too, so that it can gracefully close the session for reconnect.