Quantcast
Channel: C# Based Open Source SNMP Library for .NET and Mono
Viewing all articles
Browse latest Browse all 576

Created Unassigned: Messenger.Get (Compact Framework) [7296]

$
0
0
Can you provide some advice on how to get over the issue of trying to use:

Messenger.Get to query an SNMP device using the compact framework version of #SNMP.

When the device is connected this works fine. Then if subsequently the device gets disconnected the Messenger.Get function call hangs indefinitely.

I have looked at the source code and the following is apparent:

```
// Whatever you change, try to keep the Send and the Receive close to each other.
udpSocket.SendTo(bytes, receiver);
#if !(CF)
udpSocket.ReceiveTimeout = timeout;
#endif
int count;
try
{
count = udpSocket.Receive(reply, 0, bufSize, SocketFlags.None);
}
catch (SocketException ex)
{
// FIXME: If you use a Mono build without the fix for this issue (https://bugzilla.novell.com/show_bug.cgi?id=599488), please uncomment this code.
/*
if (SnmpMessageExtension.IsRunningOnMono && ex.ErrorCode == 10035)
{
throw TimeoutException.Create(receiver.Address, timeout);
}
// */

if (ex.ErrorCode == WSAETIMEDOUT)
{
throw TimeoutException.Create(receiver.Address, timeout);
}

throw;
}
```

Am I correct in thinking that there is no receive timeout set using the Compact Framework and hence the call never returns as there is no longer a connected socket.

Can you suggest a way to get around this issue please?


Viewing all articles
Browse latest Browse all 576

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>