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

Submitted by:  Nick Lee <nick_lee>
Submitted on:  Mon 15 Jan 2007 11:00:56 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned 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>
Project 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>
Project 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>
Project 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>
Project 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>

 

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
  • -unavailable- added by radekp (Posted a comment)
  • -unavailable- added by nick_lee (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 22 Oct 2007 08:23:08 AM UTCradekpStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Sat 22 Sep 2007 03:39:34 AM UTCradekpStatusWont Fix=>Confirmed
      Open/ClosedClosed=>Open
    Sat 22 Sep 2007 03:15:25 AM UTCradekpStatusConfirmed=>Wont Fix
      Open/ClosedOpen=>Closed
    Tue 06 Feb 2007 01:24:33 PM UTCradekpStatusNone=>Confirmed
    Mon 15 Jan 2007 11:00:56 AM UTCnick_leeAttached File-=>Added socket.cs, #11757

    Back to the top


    Powered by Savane 3.1-cleanup1