wxFtp.Connect() blocks due to socket problem
Vadim Zeitlin
vadim at wxwindows.org
Wed Nov 1 07:16:17 PST 2006
On Wed, 1 Nov 2006 09:30:32 +0100 Thomas Zehbe <tz at ingenion.de> wrote:
TZ> The implication is that any app that once has peeked the socket stream is
TZ> resonsible for emptying the peeked buffes content by doing enough Read()s on
TZ> it. Only Peek()s with an empty pushback buffer would start a read ond the
TZ> socket.
IMO Peek() should never block at all, even if the buffer is currently
empty. But even if your change is not perfect, it still definitely seems
like a step in the right direction.
TZ> I reduced Readlines buffersize to 25 bytes and all works as expected (maybe
TZ> not as efficient :-). I tested this with the socket sample and this works,
TZ> too.
But reducing it shouldn't be needed, should it? Peek(4096) should return
as many bytes as there are in the buffer (this should be > 0 as WaitForRead
has just returned true), up to 4095.
Thanks,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list