Closed puffyqi closed 4 years ago
You could start by giving more detail. For example, are you talking about an SMPP server that you're writing, or a client? And what does "expired in 6 seconds" mean? Do you want the connection to close if no TCP response data has been received for the past 6 seconds?
If you're writing a client, this example may be useful: https://github.com/OpenSmpp/opensmpp/blob/247eb56cd38ba0055e72af87c3dcf371298e9306/core/src/test/java/org/smpp/ClientSessionUnbindIT.java#L99
Hi paoloc,
Thanks for replying my post.
Yes, I want to close the connection if no TCP response data has been received for the past 6 seconds on my SMPP client app.
I have set some timeout: connection.setCommsTimeout(5000) connection.setReceiveTimeout(5000) connection.setConnectionTimeout(5000) session.getReceiver().setReceiveTimeout(6000) session.getReceiver().setQueueWaitTimeout(6000)
I was doing a 20 transactions per second test. When I submit my message (calling session.submit(request)), it took some time to return a null response value.
Hi. Within the statement "I want to close the connection if no TCP response data has been received for the past 6 seconds", we could further distinguish two possibilities:
For (1), clientConnection.setCommsTimeout()
is useful, and an exception should be thrown to your calling code, which you could act upon.
For (2), no exception will be thrown, but rather, your calling code will have to decide for itself to act appropriately when, for example, calls to clientConnection.receive()
produce no PDU within a certain amount of time. Other higher-level code such as Receiver.tryReceivePDU
similarly lets you try to receive an expected PDU within a certain time.
If you don't find your answer somewhere above, please try to be very specific about the nature of your problem.
Can anyone explain how does the below timeout works?
I try to make the connection expired in 6 seconds but the connection will hit more than 1 minutes for some of my transactions