Hi Neeraj,

If you do not like the behaviour of the DefaultTcpTransportMapping, then you 
can implement your own without using NIO/multi-threading. Closing a connection 
while a message is being sent even if the message has already been accepted by 
the Java TCP stack, is always risky. The sent message could be lost and has to 
be recent - if you have closed the connection meanwhile, the resending might 
not take place anymore.
This is totally independent from the SNMP4J DefaultTcpTransportMapping 
implementation.

Best regards,
Frank

> On 25. May 2017, at 22:57, Neeraj Vaidya <neeraj.vai...@yahoo.co.in> wrote:
> 
> Thanks Fabrice. Still I am not convinced why the DefaultTcpTransportMapping 
> class should not complete the connection and send before the next line of 
> code I.e. SNMP.close is called.
> 
> I believe the ServerThread is being started using run method and not start 
> method of Runnable. Shouldn't this just run as a normal method without 
> spawning any Thread and thus wait for completing what it is supposed to do 
> before terminating the connection.
> 
> Regards,
> Neeraj
> 
>> On 25 May 2017, at 20:25, Fabrice Bacchella <fabrice.bacche...@orange.fr> 
>> wrote:
>> 
>> 
>>> Le 24 mai 2017 à 09:50, Neeraj Vaidya <neeraj.vai...@yahoo.co.in> a écrit :
>>> 
>>> Hi Frank,
>>> Thanks for your reply I will try with UDP and let you know.
>>> We have a use case to just use TCP owing to the large size of the payload 
>>> I.e. because of MTU limitation of UDP.
>> 
>> UDP packet can be bigger than MTU. They just will be fragmented.
>> 
> 

_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
https://oosnmp.net/mailman/listinfo/snmp4j

Reply via email to