CVS Commit: network

Brieuc Jeunhomme bbp at via.ecp.fr
Sat Oct 27 17:16:11 CEST 2001


> Changed select-timeout in telnet thread from 0sec to 1sec.
> This caused the thread to take 99% CPU time.
> Now the telnet thread does take only 0% CPU and answers perfectly
> to connection requests.

In order to avoid 100% cpu consumption, NULL could be used instead of
&select_timeout. This way, the select won't be uselessly interrupted
and the thread won't be awaken each second just to see it has nothing
to do.

I also suggest, for portability, that memset(&(addr.sin_zero),0,8); at
the beginning be replaced by
memset(&(addr.sin_zero),0,sizeof(addr.sin_zero)); and of course called
before initialization of addr.sin_zero so that there will be no problem
if sizeof(addr.sin_zero) changes someday.

One more thing... I see a call to socket() in the main routine of the
telnet interface and no call to close() I can however see some calls to
return... :) Nitroooooooooox ?

And one more : strlen(WELCOME) could be replaced by
sizeof(WELCOME)-sizeof(char), right ?

-- 
BBP




More information about the vlcs-devel mailing list