[Mono-bugs] [Bug 691423] Socket.Available == 1 when socket.Receive return 0

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri May 6 02:24:03 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=691423

https://bugzilla.novell.com/show_bug.cgi?id=691423#c6


--- Comment #6 from Peter Hultqvist <peter at endnode.se> 2011-05-06 06:24:01 UTC ---
I haven't looked into generating the error myself yet, since I have no really
good idea about what is causing it.

I have tried to capture it and here it follows.
I will attach wireshark packet captures of the same events.

5/6/2011 1:59:22 AM: 0 read 1 available 264427 Bytes from 74.125.43.121:80
5/6/2011 2:59:30 AM: 0 read 1 available 75166 Bytes from 74.125.39.118:80
5/6/2011 3:00:12 AM: 0 read 1 available 18082 Bytes from 62.88.162.58:80
5/6/2011 4:59:57 AM: 0 read 1 available 126802 Bytes from 74.125.39.118:80
5/6/2011 6:00:42 AM: 0 read 1 available 23742 Bytes from 62.88.162.58:80
5/6/2011 7:00:52 AM: 0 read 1 available 18082 Bytes from 62.88.162.58:80
5/6/2011 8:00:25 AM: 0 read 1 available 82449 Bytes from 74.125.39.118:80

The hourly pattern is from my feed reader updating once an hour.
The feed-reader uses a proxy where the errors are happening.
I was using the following commit of HitProxy:
https://github.com/hultqvist/HitProxy/commit/80beb37abf8c7dec38347e3e8cdbd8e304bd0d04
With HitProxy/Connection/SocketData.cs : PipeTo(output) slightly modified to
printout the list above.

            int totalRead = 0;
            byte[] buffer = new byte[0x10000];
            while (true) {
                if (socket.Poll (5000000, SelectMode.SelectRead) == false)
                    continue;
                int available = socket.Available;
                if (available == 0)
                    return totalRead;
                int read = socket.Receive (buffer);
                if (read == 0) {
                    Console.Error.WriteLine (DateTime.Now.ToString () + ": " +
read + " read " + available + " available " + totalRead + " Bytes from " +
socket.RemoteEndPoint + "\a");
                    return totalRead;
                }
                output.Send (buffer, 0, read);
                totalRead += read;
            }

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list