Page 1 of 2

InternetShutdown sends Ctrl-C to other Applications.

Posted: Tue Dec 04, 2012 11:33 pm
by evil
Hello!
I am coding a little tool with Hollywood 5.2 on AmigaOS 4.1.5
This tool connects to the Internetnet and retrieves some data.

My Problem: When I shutdown the internet-connection, my program simply quits.
After some testing and discussing the problem on the hollywood-forum, I found out, that hollywood-tools are not the only programs, which quit after going offline.
Mui-OWB and Jabberwocky also simply exit, when I am going offline.
And even wget 1.9.1 Breaks, when I cut the internet-connection.
(normally there should be any error-message within wget, but it seems to get a Break signal from somewhere...)

For testing purpose I compiled my tool for Windows and AmigaOS3.X. And on Windows XP and on WinUAE this problem does not appear.

My Question:
Is this a bug in OS4?
Is there any workarout for that?

Best regards

Jörg

Re: InternetShutdown sends Ctrl-C to other Applications.

Posted: Tue Dec 04, 2012 11:47 pm
by ssolie
evil wrote: My Question:
Is this a bug in OS4?
Is there any workarout for that?
The TCP/IP stack automatically sends a CTRL-C signal to each Process which opened the bsdsocket.library and this is a feature. I discovered this myself when programming my Ranger system monitoring utility.

I thought there was some way to turn it off per Process but I don't remember right now sorry (away from my Amigas).

Re: InternetShutdown sends Ctrl-C to other Applications.

Posted: Wed Dec 05, 2012 1:23 am
by evil
Hello
@ssolie: So when you remember, how to turn off this feature, please let me know!

Best regards

Jörg

Re: InternetShutdown sends Ctrl-C to other Applications.

Posted: Wed Dec 05, 2012 8:23 am
by thomasrapp
evil wrote:And on Windows XP and on WinUAE this problem does not appear.
How did you test to shut down the network on WinUAE?

How did you shut down the network on Windows? Is it even possible?

I am quite sure that Miami also tries to quit all programs which use bsdsocket.library when you click the close gadget.

Re: InternetShutdown sends Ctrl-C to other Applications.

Posted: Wed Dec 05, 2012 9:40 am
by evil
Hello!
I simply cut the the Wireless-Connection on Windows.
Regards
Jörg

Re: InternetShutdown sends Ctrl-C to other Applications.

Posted: Wed Dec 05, 2012 11:04 am
by thomasrapp
But this does not shut down the TCP/IP stack.

The netshutdown command removes TCP/IP from the system completely. In order to do this is has to ensure that all users of TCP/IP (i.e. all programs which opened bsdsocket.library) are stopped. Only if nobody uses bsdsocket.library any more, the TCP/IP stack can be removed. If a program refuses to close bsdsocket.library, the netshutdown command will fail.

Re: InternetShutdown sends Ctrl-C to other Applications.

Posted: Wed Dec 05, 2012 11:33 am
by evil
But IBrowse and YAM do not quit, when using netshutdown. And shutdown seems to work successful, even if yam or/and IBrowse are running.
Although, they are listet in commodities/Exchange, they are not listet, when calling cli-status.
So I cannot Break them using Ctrl-C...
Is there a way to decide, whether a program should quit or not??


Serious...

Re: InternetShutdown sends Ctrl-C to other Applications.

Posted: Wed Dec 05, 2012 11:49 am
by tonyw
But IBrowse and YAM do not quit, when using netshutdown.
That may be because those programs do not listen for Ctrl-C Break signals.

Re: InternetShutdown sends Ctrl-C to other Applications.

Posted: Wed Dec 05, 2012 11:56 am
by evil
But in that case, NetShutDown should fail.

Re: InternetShutdown sends Ctrl-C to other Applications.

Posted: Wed Dec 05, 2012 12:15 pm
by cha05e90
tonyw wrote:
But IBrowse and YAM do not quit, when using netshutdown.
That may be because those programs do not listen for Ctrl-C Break signals.
Or maybe they close bsdsocket.library after each access (maybe true for YAM but I have my doubts here with IBrowse).