[Mono-dev] Possible bug in System.Net.Sockets.Socket?

Rodrigo Kumpera kumpera at gmail.com
Tue Jan 29 13:27:04 UTC 2013


Please file a bug with a minimal test case that shows the problem.


On Tue, Jan 29, 2013 at 6:47 AM, Esben Laursen <hyber at hyber.dk> wrote:

> Hi Guys,
>
> This my first post to the develop list, so I have that I have found the
> correct place for my questions.
>
> I have a problem with the sharpsnmplib (http://sharpsnmplib.codeplex.**
> com/ <http://sharpsnmplib.codeplex.com/>) that when I run mono-3.0.3 it
> halts my program even tough I have set a time-out of 3000ms on the socket.
> I have a watchdog that after about 10minutes reset the thread and tries
> again.
>
> I am fairly convinced that it is a problem in the framework, but of course
> not sure.
>
> I tried to build a reproduction of my problem where I implemented my
> method as Async with a waitone time-out of twice the socket time-out. It
> happens from time to time that the waitone would trigger before the
> time-out of the socket. (I tested this on 2.6.7, 2.10.8 and 3.0.3 and they
> all had the issue)
>
> That lead me to build a simple udp socket client and server app.
>
> It works the following way:
>
> Client sends a UDP packet to the server
> The server reads the socket and returns the same data back to the client
> Client reads the socket and closes it
> Then loop back to the beginning.
>
> This works great on Windows (and mono if you run both apps locally)
>
> Then I tested with the server app running on my Windows7 and the client
> app running on a Debian (tried both 2.6.7 and 3.0.3) and it would only send
> out 20-30 udp packets before it would that giving me this output to the
> console:
>
> Operation on non-blocking socket would block
> Operation on non-blocking socket would block
> Operation on non-blocking socket would block
> Operation on non-blocking socket would block
> Operation on non-blocking socket would block
>
> after a little while it would send out some more packets.
>
> Here is a link to my code: http://pastebin.com/3ehqSpWM
>
> The question is the following:
>
> 1. I guess this is a bug, should I create it in bugzilla?
>
> 2. If I have a multithreaded app that sends out hundreds or thousand of
> UDP requests, do you think this could cause the socket to be block for 10
> minutes at a time? I am not sure its the same problem and the problem I
> have with my code seems to be worse on mono-3.0.3, but not worse in my
> reproduction app (although it is not threaded)
>
> What are your thoughts?
>
> Many thanks for your help.
>
> Cheers
>
> Esben
>
> ______________________________**_________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.**com <Mono-devel-list at lists.ximian.com>
> http://lists.ximian.com/**mailman/listinfo/mono-devel-**list<http://lists.ximian.com/mailman/listinfo/mono-devel-list>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130129/dadd112d/attachment.html>


More information about the Mono-devel-list mailing list