List Info

Thread: Using async socket methods prevents program to exit




Using async socket methods prevents program to exit
user name
2007-08-24 09:14:39
URL:
  <http://savann
ah.gnu.org/bugs/?20885>

                 Summary: Using async socket methods
prevents program to exit
                 Project: DotGNU Portable.NET
            Submitted by: radekp
            Submitted on: Friday 08/24/2007 at 14:14
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Friday 08/24/2007 at 14:14  Name: ConsoleApp4.tar.gz 
Size: 2kB   By:
radekp
sample application
<http://savannah.gnu.org/bugs/download.php?file_id=137
86>

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20885>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

Using async socket methods prevents program to exit
user name
2007-09-11 06:37:04
Follow-up Comment #1, bug #20885 (project dotgnu-pnet):

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)
    _______________________________________________________

Additional Item Attachment:

File name: blocking.tar.gz                Size:33 KB


    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20885>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

Using async socket methods prevents program to exit
user name
2007-10-12 10:18:58
Update of bug #20885 (project dotgnu-pnet):

                  Status:                    None =>
Fixed                  
             Open/Closed:                    Open =>
Closed                 

    _______________________________________________________

Follow-up Comment #2:

Fixed in current CVS

    _______________________________________________________

Reply to this item at:

  <http://savann
ah.gnu.org/bugs/?20885>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/


_______________________________________________
Pnet-developers mailing list
Pnet-developersdotgnu.org
ht
tp://dotgnu.org/mailman/listinfo/pnet-developers

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )