[En-Nut-Discussion] Re: Multiple sockets, and threads

Robert Hildebrand robert.hildebrand at ims.fhg.de
Wed Apr 2 13:11:55 CEST 2003


Hi Stephen,

the actual httpd-demo uses 5 sockets.
I had a problem using multiple sockets in combination with local
sockethandles. All was well when I used global handles with different names
e.g.

TCPSOCKET *telnetsock;
TCPSOCKET *httpsock;
TCPSOCKET *debugsock;

The compiler (gcc 3.3) seems to confuse the handles when using them in the
following manner:

//( file telnet.c)
TCPSOCKET *sock;

THREAD(telnet, arg)
....

//(file debug.c)
TCPSOCKET *sock;

THREAD(debugthread, arg)
....


I don't know the reason but switching to global handles solved the problem,
maybe by accident as the httpd-demo uses local handles.

Robert Hildebrand




More information about the En-Nut-Discussion mailing list