"David Bourgeois" <[EMAIL PROTECTED]> writes:
> But looking into this, I came up with a question about this:
>  if ((send(tcp_clients_handle[i], data, sizeof(tcp_frame_t), 0)) == 0)
>             tcp_remove_client(i);
>
> Rémi got this in the past if the client was exited without telling to
> the  daemon, 'send' would return 0.
> Looking at the man page, I can't find how send can return 0, at least
> now  in non blocking mode either it adds the data or it returns -1 as
> an error.  But in blocking mode, 0 would mean that 0 bytes have been
> successfully  sent. Any clarification about this?
> I guess that we can change the '== 0' into '<= 0' or better '< 0' if
> we're  sure 0 can't happen anymore in non-blocking mode.

Unless I'm mistaken, in the current code the sockets are *blocking*.
If send() returns < 0, we can assume the connection to the client has
been closed, yes.

        Damien

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
tux-droid-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-user

Reply via email to