bugDotGNU Portable.NET - Bugs: bug #20885, Using async socket methods...

 
 

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

bug #20885: Using async socket methods prevents program to exit

Submitted by:  Radek Polak <radekp>
Submitted on:  Fri 24 Aug 2007 02:14:37 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 12 Oct 2007 03:18:57 PM UTC, comment #2:

Fixed in current CVS

Radek Polak <radekp>
Project Member
Tue 11 Sep 2007 11:37:04 AM UTC, comment #1:

Attached is a patch with sample application.

In short: socket now registers thread that enters blocking operation and unregisters it when operation ends. When you close socket, all registered threads are unblocked by sending IL_SIG_ABORT.

IL_SIG_ABORT is also sent to background threads while process is destroyed. This ensures that background threads will not prevent from from ending.

IL_SIG_ABORT is not called on foreground thread because blocking foreground thread must prevent program to exit (this is correct behavior).

(file #13915)

Radek Polak <radekp>
Project Member
Fri 24 Aug 2007 02:14:37 PM UTC, original submission:

Hi,
after using async operation on socket e.g. Socket.BeginAccept() the program does not terminate. It just hangs forever or until client is accepted.

Attached is a sample program - on .NET it prints "Ending..." and after one second it exits. On pnet it prints "Ending..." and never exits unless client is connnected to the socket (e.g. by running command telnet localhost 8000).

IMO the problem is, that async method call starts a new thread, that is preventing ilrun to exit.

Any comments or patches are welcome.

Thanks Radek

Radek Polak <radekp>
Project Member

 

Attached Files
file #13915:  blocking.tar.gz added by radekp (33KiB - application/x-tgz - patch with test app)
file #13786:  ConsoleApp4.tar.gz added by radekp (2KiB - application/x-gzip - sample application)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by radekp (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 12 Oct 2007 03:18:57 PM UTCradekpStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 11 Sep 2007 11:37:04 AM UTCradekpAttached File-=>Added blocking.tar.gz, #13915
    Fri 24 Aug 2007 02:14:38 PM UTCradekpAttached File-=>Added ConsoleApp4.tar.gz, #13786

    Back to the top


    Powered by Savane 3.1-cleanup1