wxFtp.Connect() blocks due to socket problem
Thomas Zehbe
tz at ingenion.de
Wed Nov 1 08:13:19 PST 2006
Am Mittwoch, 1. November 2006 16:16 schrieb Vadim Zeitlin:
> 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.
So I'll upload the patch to sf. If I'll find some time, I will have a second
look on it.
>
> 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
No, it's not needed. I did not mention, that I did it for testing to see what
happens, if a peek/read returns incomplete lines.
Regards,
Thomas
> as many bytes as there are in the buffer (this should be > 0 as WaitForRead
> has just returned true), up to 4095.
>
> Thanks,
> VZ
--
Dipl.-Ing. Thomas Zehbe
INGENION GmbH
Kuhweide 6
31552 Apelern
Fon: 05043 / 40 57 90 4
Fax: 05043 / 40 57 90 7
More information about the wx-users
mailing list