[Mono-dev] TCP Async

Greg Young gregoryyoung1 at gmail.com
Tue Jul 17 14:47:34 UTC 2012


Btw to avoid confusion and duplicated work if someone starts could we just
sync a bit in this thread?

On Tuesday, July 17, 2012, Greg Young wrote:

> Hey all.
>
> As this is a big issue for us and I feel a huge problem for mono in
> general at this point as it means sockets basically dont work which is a
> strong point of unix environments, I would like to propose something I have
> done in the past. I am willing to offer a bounty (personally) for a working
> fix to this section of code of $500 usd (more if done quickly).
>
> Acceptance criteria is the included test working in a stable fashion in
> Linux / bsd but just Linux is acceptable as well,
>
> I honestly wish more people would do this kind of thing with OSS projects.
>
> Cheers,
>
> Greg
>
> On Saturday, July 7, 2012, Yuriy Solodkyy wrote:
>
>> Hi Rodrigo,
>>
>> please find a small sample app at
>> https://github.com/ysw/mono-socket-problem
>>
>> This app can start in either server or client mode.  These modes only
>> differ in whether it listens for connections on multiple ports or
>> connects to server on multiple ports. Upon connecting to or accepting
>> connection it immediately sends some data, and then sends next chunk
>> of data in response to any data received from the other side.  There
>> are some random delays in code and we limit outgoing traffic on each
>> connection not to be significantly higher than inbound.
>>
>> There is also a separate thread which regularly checks status of every
>> connection and report any connections that are awaiting a callback,
>> but their status obtained with socket.poll is already READY.  (A
>> several seconds delay is still allowed).
>>
>> See also the README file.
>>
>>
>> Also, it seems that constantly changing men/max threads in ThreadPool
>> increases probability of the problem. See code.
>> Please let me know if this sample app works for you.
>>
>> Hope it helps
>>
>>
>> Thank you,
>> Yuriy
>>
>>
>> We've been aware of such issues, could you file a bug and attach a test
>> case with it please?
>>
>> This would really really help us fix it.
>>
>> On Wed, Jun 27, 2012 at 4:08 AM, Greg Young <gregoryyoung1 at gmail.com>
>> wrote:
>>
>> > We are experiencing an issue with async behaviours in sockets (with
>> > SendAsync/callback not Begin/End).
>> >
>> > Our visible issue is that when in a send loop we will fail on our
>> > heartbeats. After debugging and counting calls into/out of
>> > SendAsync/callback we see that we are inside of a call to SendAsync
>> > (eg: it never returns, in our case for 10 seconds before we declare
>> > the socket dead). We can duplicate this fairly regularly on
>> > mac/bsd/linux though its nonconsistent (sometimes it may happen
>> > repeatedly other times it works fine). The code does not have such
>> > issues on MS CLR. We are also running on loopback so its unlikely that
>> > an underlying network problem is causing the hang up. The code itself
>> > is fairly straight forward (not that different than the MS example of
>> > the API except that its fully async (separate send/receive loops while
>> > the example is request/response))
>> >
>> > I am pulling sources now to build latest but does anyone happen to
>> > know of known issues with this sort of thing?
>> >
>> > Cheers,
>> >
>> > Greg
>> >
>> > --
>> > Le doute n'est pas une condition agréable, mais la certitude est
>> absurde.
>> > _______________________________________________
>> > Mono-devel-list mailing list
>> > Mono-devel-list at lists.ximian.com
>> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
>> >
>>
>> --
>> Yuriy Solodkyy
>> (y.solodkyy at gmail.com)
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>
>
> --
> Le doute n'est pas une condition agréable, mais la certitude est absurde.
>


-- 
Le doute n'est pas une condition agréable, mais la certitude est absurde.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120717/0cbc1c66/attachment.html>


More information about the Mono-devel-list mailing list