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

Submitter:  Radek Polak <radekp>
Submitted:  Fri 24 Aug 2007 02:14:37 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

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

Fixed in current CVS

Radek Polak <radekp>
Group 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>
Group 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>
Group Member

 

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

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
  • -email is unavailable- added by radekp (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-10-12 radekp StatusNone Fixed
        Open/ClosedOpen Closed
    2007-09-11 radekp Attached File- Added blocking.tar.gz, #13915
    2007-08-24 radekp Attached File- Added ConsoleApp4.tar.gz, #13786

    Back to the top

    Powered by Savane 3.12