[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-myserver] Test case for class socket ready + patch
From: |
Giuseppe Scrivano |
Subject: |
Re: [bug-myserver] Test case for class socket ready + patch |
Date: |
Sun, 29 Mar 2009 11:46:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) |
Thank you, I have committed the patch. The test case is very long, does
it depend from the tests complexity or because the MyServer socket API
are not very friendly to use?
> Here are some notes:In socket.cpp u_long Socket::bytesToRead -- should
> the macro #ifdef FIONHEADbe changed to #ifdef WIN32 ?
Yes, I think it is used only there.
>In socket.cpp int Socket::recv ( char*, int, int, u_long ) -- how does a
> caller distinguish between orderly shutdown and the returned 0 at the
> end?If there's a timeout and no sockets are ready, then also value
> of 0 isreturned again.In socket.cpp int Socket::recv ( char*, int, int
> ) -- i thought that the value of 0 returned by recv is not an
> error. Or is it the desired behaviourto be to always handle anything
> but > 0 values, as errors ? ( "unlessdata was recv()`ed, it's an
> error - do something" )
We need to change it, return 0 both on a closed connection and on a
timeout is not a clear behaviour.
Regards,
Giuseppe