There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
Exception : System.Net.Sockets.SocketException
I'm using SharpSNMP version 9.0.1 and I have the following exception throw by the library.
Exception : System.Net.Sockets.SocketException :: A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself
After some investigation, it appears that in my project, we receive large SNMP pdu, more than 8kb.
In the interface we can only manage the max pdu size but by default it's near 64kb (Messenger.MaxMessageSize 65507 bytes).
But at Socket level the value take into account is the defaut value from Socket.ReceiveBufferSize: Definition is as follow:
// Gets or sets a value that specifies the size of the receive buffer of the
// An System.Int32 that contains the size, in bytes, of the receive buffer.
// The default is 8192.
// An error occurred when attempting to access the socket.
// The System.Net.Sockets.Socket has been closed.
// The value specified for a set operation is less than 0.
After managing to buil my own version of the library using Messenger.MaxMessageSize for the socket buffer allocation, the problem is fixed.