Re: [tuxdroid-user] Small issue with tcp/ip when disconnecting the socket
Status: Beta
Brought to you by:
ks156
From: David B. <da...@ja...> - 2007-06-21 11:08:11
|
False alarm, it seems it's a bug in tuxgi which still tries to get the RF status even after it's disconnected. Sorry for the trouble :-/ 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. Cheers, David |