Hi Steve,
Yes, http_init() should be called after sock_init()
If you look closely at the code you will see that sock_init() is
called before http_init()
BOOTUP====================
1. Static IP - > sock_init() is called at loadNetwork() before
runtimeIPChange() is called
2. DHCP IP -> loadNetwork simply calls runtimeIPChange() and sock_init
() is called there.
So no matter what type, sock_init() is called before http_init() is
called.
AT RUNTIME==================
Only call the runtimeIPChange() function. Yes this is a method of my
own and not of ZWorld.
It does call the sock_init() each time activating a DHCP address but
I think because the interface is 'down' it does not make a
difference.
(try to remove it and see if fails *grin*)
Going from a DHCP to a static, it does not call sock_init() at all.
Going either way, both calls tcp_reserveport(80) though.
After this code I've swapped between the two types manytimes
manually, but no crashes. So the 'horrible' things are undiscovered
yet. If you discover anything please let me know too. :)
Nil
--- In rabbit-semi@rabb..., Steve Trigero <seecwriter@y...>
wrote:
> Nil,
>
> According to "the manual", http_init() MUST be called
> after sock_init(). But in your code, I don't see
> sock_init() being called at all on boot up.
> Is runtimeIPChange your procedure, as apposed to a DC
> lib function? Maybe that's where sock_init() is being
> called?
> It also looks to me like sock_init() will get called
> more than once when you switch between Static IP and
> DHCP. I thought sock_init() could only be called one
> time, otherwise horrible things happen to your
> program.
>
> Steve