Hi TI:
I recently imported the UDP example and was able to get it running with a UDP server.
Per the example, the config file contained:
Global.networkOpenHook = "&netOpenHook";
And I added the following:
Global.networkIPAddrHook = '&mynetworkIPAddrHook';
As I understand it, netOpenHook() dynamically configured Task echoFxn(). Task echoFxn() handled UDP I/O.
I included mynetworkIPAddrHook() to show me when the IP was assigned from the router and set an IP Ready Flag.
Changes..
I moved the dynamic allocation of Task echoFxn() to main() from netOpenHook();
netOpenHook() is essentially a shell with a small entry/exit message.
I used an "IP Ready Flag" in mynetworkIPAddrHook() to 'hold' in echoFxn() until the IP was ready (IP Ready Flag).
Results...
The echoFxn() Task holds at the top of the echoFxn() Task until the IP Ready Flag is set.
Once the IP Ready Flag is set, the echoFxn() Task continues with a call to socket().
The return value of the socket() call is -1.
When inspecting the errno, errno is also -1. This was very unexpected. I did not think errno could be -1.
Did I do something illegal by dynamically allocating Tasks echoFxn in main()?
Is the IP stack fully setup when I call socket() in echoFxn?
Other?
Any thoughts would be greatly appreciated.
Thanks
Rick