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

Yuriy Solodkyy yuriy at couldbedone.com
Tue Jan 29 13:26:30 UTC 2013


Hi,

we have a problem with mono sometimes not invoking a callback when
completing an operation.  We use a patch from gonzalo.mono at gmail.com which
fixes the problem for us. You can try building mono with this patch and
check if it helps.

https://github.com/ysw/mono-socket-problem/blob/master/Patches/cb_fix.patch

-yuriy






On Tue, Jan 29, 2013 at 1:47 PM, 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>
>



-- 
Yuriy Solodkyy
(y.solodkyy at gmail.com)



-- 
Yuriy Solodkyy
(y.solodkyy at gmail.com)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20130129/80a936c3/attachment-0001.html>


More information about the Mono-devel-list mailing list