Page 1 of 2

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

Posted: Mon Jan 06, 2014 5:56 pm
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!

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

Posted: Mon Jan 06, 2014 6:16 pm
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

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

Posted: Mon Jan 06, 2014 8:02 pm
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!

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

Posted: Mon Jan 06, 2014 9:27 pm
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.

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

Posted: Tue Jan 07, 2014 5:29 pm
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)

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

Posted: Tue Jan 07, 2014 5:59 pm
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.

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

Posted: Tue Jan 07, 2014 6:49 pm
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 ;)

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

Posted: Wed Jan 08, 2014 1:55 pm
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 )
  {
..

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

Posted: Wed Jan 08, 2014 2:31 pm
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

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

Posted: Wed Jan 08, 2014 4:09 pm
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 )
  {
..
}