How to manually restart TCP/IP stack in OS4.1?

A forum for general AmigaOS 4.x support questions that are not platform-specific
themamboman
Posts: 18
Joined: Wed Oct 09, 2013 7:54 pm

How to manually restart TCP/IP stack in OS4.1?

Post by themamboman »

Hello all,

While I'm still working to get my AmigaOneXE to work, I was able to pick up used micro-A1C, which is a fun little computer. It has a licensed copy of OS4.1, updated to the absolute latest.

I noticed that many times, I have to rebuild my internal ethernet settings before I can ping even my own router. Once I make the changes, I see a window popup saying that it is restarting the stack, when that happens, all is well.

Until I figure out what is really going on, I was curious how we restart the TCP stack manually?

Thanks!
blmara
Posts: 76
Joined: Thu Jun 23, 2011 10:03 am
Location: Vantaa, Finland

Re: How to manually restart TCP/IP stack in OS4.1?

Post by blmara »

themamboman wrote:Hello all,

While I'm still working to get my AmigaOneXE to work, I was able to pick up used micro-A1C, which is a fun little computer. It has a licensed copy of OS4.1, updated to the absolute latest.

I noticed that many times, I have to rebuild my internal ethernet settings before I can ping even my own router. Once I make the changes, I see a window popup saying that it is restarting the stack, when that happens, all is well.

Until I figure out what is really going on, I was curious how we restart the TCP stack manually?

Thanks!
I'm not sure if you mean this, but if I turn my Telewell ADSL Modem/Router off and on, the X1000/OS4.1 doesn't get online automatically again (as my Wind*** machine does). I have the following procedure:

- C:NetShutDown (closes the network connections)
- run >nil: AddnetInterface interface interface (in my system, the interface name is simply 'interface')
- run >nil: Amidock (when shutting down the network the Amidock closes also for some reason, maybe because of some of the dockies)

Marko
Marko
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: How to manually restart TCP/IP stack in OS4.1?

Post by chris »

blmara wrote:- run >nil: Amidock (when shutting down the network the Amidock closes also for some reason, maybe because of some of the dockies)
When the TCP/IP stack shuts down, it sends a break command to any programs that are using it. You probably have a docky installed which utilises or monitors the network. Other network programs will also shut down. It is very important to make sure everything is saved before running NetShutDown as most things will quit without warning!
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: How to manually restart TCP/IP stack in OS4.1?

Post by zzd10h »

For AmiDock, if you use NetDock, it's the culprit.

I tried to handle the SIGBREAK in NetDock months ago but didn't succeed to implement it.
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: How to manually restart TCP/IP stack in OS4.1?

Post by javierdlr »

zzd10h wrote:For AmiDock, if you use NetDock, it's the culprit.

I tried to handle the SIGBREAK in NetDock months ago but didn't succeed to implement it.
If you add

Code: Select all

signal(SIGINT, SIG_IGN); // Do CTRL-C checking ourself
does it work the way you want? (extracted from Mixer sources)
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 1:06 am

Re: How to manually restart TCP/IP stack in OS4.1?

Post by xenic »

zzd10h wrote:For AmiDock, if you use NetDock, it's the culprit.
I tried to handle the SIGBREAK in NetDock months ago but didn't succeed to implement it.
As javierdlr points out, adding signal(SIGINT, SIG_IGN) at the beginning of a program and adding the break flag in your input loop like Wait(mysignals | SIGBREAKF_CTRL_C) should work in a program. I don't know how dockies work but if AmiDock is receiving signals that are passed on to the appropriate dockie, it might be reacting to a break signal (Ctrl-C) that is intended for NetDock. You may need to start a seperate process that interacts with RoadShow and passes info to NetDock with exec messages. Of course, that's just a wild guess since I've never worked on a dockie or seen the NetDock source code.
AmigaOne X1000 with 2GB memory - OS4.1 FE
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: How to manually restart TCP/IP stack in OS4.1?

Post by zzd10h »

@Javierdir :
Thank you but I don't find your signal in your mixer/docky sources.

@Xenic :
The problem is there is no wait loop in a docky, at least according my very little docky knowledge.

But thx guys for help ;)
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: How to manually restart TCP/IP stack in OS4.1?

Post by javierdlr »

zzd10h wrote:@Javierdir :
Thank you but I don't find your signal in your mixer/docky sources.

@Xenic :
The problem is there is no wait loop in a docky, at least according my very little docky knowledge.

But thx guys for help ;)
mixer original in main.c (althought is commented out):

Code: Select all

signal(SIGINT, SIG_IGN); // Do CTRL+C checking ourself
You don't make use of:

Code: Select all

   IIntuition->GetAttr(WINDOW_SigMask, win[OID_MAIN], &wsignal);
   while( !ProcessDockWindow() ); // Input Event Loop
..
BOOL ProcessDockWindow(void)
{
 uint32 wait = IExec->Wait(wsignal|SIGBREAKF_CTRL_C);

 if(wait & SIGBREAKF_CTRL_C) return FALSE;

 if(wait & wsignal)
 {
  uint32 result = WMHI_LASTMSG;
  int16 code = 0;

  while( (result = IIntuition->IDoMethod(win[OID_MAIN], WM_HANDLEINPUT, &code)) != WMHI_LASTMSG )
  {
..
zzd10h
Posts: 546
Joined: Sun Sep 16, 2012 6:40 am
Location: France

Re: How to manually restart TCP/IP stack in OS4.1?

Post by zzd10h »

I don't have a "BOOL ProcessDockWindow(void)" in my Docky and I don't find it in the Autodocs.

Isn't it one of your own function ?
And during your wait, the program no more respond, no ?

Thank you
Guillaume
http://apps.amistore.net/zTools
X1000 - AmigaOS 4.1.6 / 4.1 FE
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: How to manually restart TCP/IP stack in OS4.1?

Post by javierdlr »

zzd10h wrote:I don't have a "BOOL ProcessDockWindow(void)" in my Docky and I don't find it in the Autodocs.

1)Isn't it one of your own function ?
2)And during your wait, the program no more respond, no ?
1)Yes, sorry 'BOOL ProcessDockWindow(void)' it's an own function.
2)Thus I use CreateNewProcess() to detaches from "code"/docky.

More & less is something like this (not in front of my miggy sorry):

Code: Select all

case DOCKY_SINGLECLICK:
 if(!SingleClick) break;
case DOCKY_DOUBLECLIK:
 OpenWindowNP(); // uses CreateNewProcess -> detaches from "code"/docky
break;
..
void OpenWindowNP(void)
{
CREATENEWPROCESS calling OpenWindow()
}

void OpenWindow(void)
{
blah blah
IIntuition->GetAttr(WINDOW_SigMask, win[OID_MAIN], &wsignal);
while( !ProcessDockWindow() ); // Input Event Loop

blah blah
REACTION DisposeObjects
blah blah
}
..
BOOL ProcessDockWindow(void)
{
 uint32 wait = IExec->Wait(wsignal|SIGBREAKF_CTRL_C);

 if(wait & SIGBREAKF_CTRL_C) return FALSE;

 if(wait & wsignal)
 {
  uint32 result = WMHI_LASTMSG;
  int16 code = 0;

  while( (result = IIntuition->IDoMethod(win[OID_MAIN], WM_HANDLEINPUT, &code)) != WMHI_LASTMSG )
  {
..
}
Post Reply