[Mono-bugs] [Bug 494275] New: send zero-sized buffer to Socket doesn't send empty tcp packet

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Apr 13 05:44:47 EDT 2009


           Summary: send zero-sized buffer to Socket doesn't send empty
                    tcp packet
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.2.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: vsevolodp at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:
Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729)

when i try to check connection like this

            bool blockingState = Socket.Blocking;
                byte[] tmp = new byte[1];

                Socket.Blocking = false;
                Socket.Send(tmp, 0, SocketFlags.None);
            catch (SocketException e)
                // 10035 == WSAEWOULDBLOCK
                if (!e.NativeErrorCode.Equals(10035))
                Socket.Blocking = blockingState;

it doesn't send empty TCP packet. so I can't check if connection is alive.
ms framework does and ms advise to use this technique to check connection

Reproducible: Always

Steps to Reproduce:
1. connect client socket to server socket
2. kill server process with connected socket
3. try to check connection from client side with code from details
Actual Results:  
client doesn't send empty tcp packet

Expected Results:  
client should send empty tcp packet and report problems if any

see \mcs\class\System\System.Net.Sockets\Socket.cs
internal int Send_nochecks (byte [] buf, int offset, int size, SocketFlags
flags, out SocketError error) 
            if (size == 0) {
                error = SocketError.Success;
                return 0;

Configure bugmail: http://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