Nuno Carvalho wrote:
> It's possible to have asynchronous socket programming just with select()
> and without fork()ing !?
Yes. Which is the best approach depends upon whether the connections
are related in any way.
For the case where the connections are all independent (e.g.
telnet/FTP/HTTP servers), using fork() is preferable.
For the case where the connections are related (e.g. a MUD or
conferencing system), then either use select() or threads.
> If I uncomment the lines that had fork()ing process it already support
> asynchronous communications ! It's a good appologie(use select+fork) or
> should I only work with fork()ing processes !?
You shouldn't need to use both select() and fork(). If you use fork(),
then each process only deals with a single connection, so there is no
need to use select().
> There's on file a string comparations(strcmp) which is never executed! It
> seems read() write to buffer's variable more than the expected words - for
> "nemanuel" i got a strlen of 10 !!
You are probably including the line terminator. The expression
strlen("nemanuel\r\n")
will return 10.
--
Glynn Clements <[EMAIL PROTECTED]>