Hi, all!
I have ported the LWIP stack, and got it basically working. However, I
am running into some problems with multiple sockets, and I was wondering
if my structure is wrong.
Unlike many OS'es, I am running under a cooperatively-scheduled OS. A
running task never gets interrupted except by a real interrupt, or when
it voluntarily suspends.
I have 2 tasks running the basic stack; one calls ethernetif_input()
repeatedly (and suspends after each call). The other one calls
tcpip_thread().
The only places where lwip code can suspend is either:
a) when reading a mailbox which is empty (suspends once and then
returns) - this is, in general, how the tcpip_thread suspends.
b) When waiting on a semaphore (suspends repeatedly until sem available
or timeout).
I have several application tasks which are using the sockets. Some of
these are listeners, some are initiators (they make the connection to a
remote host). They are using the netconn_new, netconn_connect,
netconn_recv, netconn_write, etc. functions. These functions are always
called only at the application level (i.e. never from an interrupt).
I assumed that this would be a safe environment; i.e. that none of the
netconn functions would suspend (waiting for mbox or sem) when it was
unsafe for a different task to call one of these functions, but I
suspect I may be wrong here?
As I said above, this works perfectly when, for example, I just have one
or two listening sockets, but when I try to mix listening and initiating
sockets, the whole thing comes crashing down.
Any advice will be appreciated!
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users