InternetShutdown sends Ctrl-C to other Applications.

A forum for general AmigaOS 4.x support questions that are not platform-specific
evil
Posts: 7
Joined: Sat Jun 18, 2011 1:54 pm

InternetShutdown sends Ctrl-C to other Applications.

Post 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
User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: InternetShutdown sends Ctrl-C to other Applications.

Post 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).
ExecSG Team Lead
evil
Posts: 7
Joined: Sat Jun 18, 2011 1:54 pm

Re: InternetShutdown sends Ctrl-C to other Applications.

Post by evil »

Hello
@ssolie: So when you remember, how to turn off this feature, please let me know!

Best regards

Jörg
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: InternetShutdown sends Ctrl-C to other Applications.

Post 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.
evil
Posts: 7
Joined: Sat Jun 18, 2011 1:54 pm

Re: InternetShutdown sends Ctrl-C to other Applications.

Post by evil »

Hello!
I simply cut the the Wireless-Connection on Windows.
Regards
Jörg
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: InternetShutdown sends Ctrl-C to other Applications.

Post 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.
evil
Posts: 7
Joined: Sat Jun 18, 2011 1:54 pm

Re: InternetShutdown sends Ctrl-C to other Applications.

Post 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...
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1483
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: InternetShutdown sends Ctrl-C to other Applications.

Post 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.
cheers
tony
evil
Posts: 7
Joined: Sat Jun 18, 2011 1:54 pm

Re: InternetShutdown sends Ctrl-C to other Applications.

Post by evil »

But in that case, NetShutDown should fail.
User avatar
cha05e90
Posts: 90
Joined: Fri Jun 17, 2011 11:15 pm
Location: Germany
Contact:

Re: InternetShutdown sends Ctrl-C to other Applications.

Post 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).
X1000|II/G4|440ep|2000/060|2000/040|1000
Post Reply