bugDotGNU Portable.NET - Bugs: bug #18785, Sockets block forever

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #18785: Sockets block forever

Submitter:  Nick Lee <nick_lee>
Submitted:  Mon 15 Jan 2007 11:00:56 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Mon 22 Oct 2007 08:23:08 AM UTC, comment #4: 

Fixed in CVS, please note that the exception message on windows is not correct, because socket error codes are not implemented yet.

Radek Polak <radekp>
Group Member
Sat 22 Sep 2007 03:39:34 AM UTC, comment #3: 

Hmm i closed this bug too early, reopening to see if we can get the sample work.

Radek Polak <radekp>
Group Member
Sat 22 Sep 2007 03:14:15 AM UTC, comment #2: 

Hi Nick,
i found these lines of code in Socket.SetSocketOption():

if(optionName == SocketOptionName.ReceiveTimeout ||
   optionName == SocketOptionName.SendTimeout)
{
// These options are fixed by the Internet RFC's,
// are should never be changed by applications.
// But there is existing C# code that thinks they
// can be set to different values.  Quietly ignore.
return;
}


It looks like these options should not be used. I am ATM working on how to cancel socket blocking. I did a patch and waiting for approval to commit. You can check bug  #20885.

Radek

Radek Polak <radekp>
Group Member
Tue 06 Feb 2007 01:24:33 PM UTC, comment #1: 

It looks like setting socket options is implemented, but we should add checks for sockets options in configure script and set SO_RCVTIMEO symbol if it is available.

Radek Polak <radekp>
Group Member
Mon 15 Jan 2007 11:00:56 AM UTC, original submission:  

There doesn't seem to be a way to stop sockets blocking indefinitely.

1. Setting the ReceiveTimeout option on the socket has no effect - when you read it back it is still 0, which means "infinite timeout". Looking at the source code, there is a message saying that timeouts cannot be set according to the RFCs (which I'm sure isn't true - all other implementations of sockets on all platforms and all application frameworks support setting socket timeouts - besides, even if this was the case, the timeout wouldn't be set to infinity!).

2. Setting Blocking to false doesn't stop the socket blocking (change "s.Blocking = true;" in attached code to "s.Blocking = false;".

Nick Lee <nick_lee>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #11757:  socket.cs added by nick_lee (1KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by radekp (Posted a comment)
  • -email is unavailable- added by nick_lee (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-10-22 radekp StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2007-09-22 radekp StatusWont Fix Confirmed
        Open/ClosedClosed Open
    2007-09-22 radekp StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2007-02-06 radekp StatusNone Confirmed
    2007-01-15 nick_lee Attached File- Added socket.cs, #11757

    Back to the top

    Powered by Savane 3.13-0329.
    Corresponding source code