From kde-devel Wed Jul 16 09:21:01 2003 From: Thiago Macieira Date: Wed, 16 Jul 2003 09:21:01 +0000 To: kde-devel Subject: Re: KExtendedSocket & waitForMore X-MARC-Message: https://marc.info/?l=kde-devel&m=105834750215568 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============2059921157632274==" --===============2059921157632274== Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Boundary-02=_DkRF/r7fiOw7/Gj"; charset="iso-8859-1" Content-Transfer-Encoding: 7bit --Boundary-02=_DkRF/r7fiOw7/Gj Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Kostko wrote: >I have the folowing code: > >// ... >writeBlock(cmd.latin1(), cmd.length()); >int readBytes =3D waitForMore(5000); // wait for the server's response > >if (readBytes > 0) { > // read it... >} else { > fprintf(stderr, "nothing to read\n"); > return; >} > >and i always get "nothing to read", and right after this the readReady >signal is emited. the socket has flags "ipv4Socket | ipv6Socket | >inputBufferedSocket" and it is non-blocking. so what am i doing wrong >here ? Hello, your code is right. I think you've spotted an error in KExtendedSocket that= =20 might be the cause of your problem. In KExtendedSocket::waitForMore, please try this and report to me if it sol= ves=20 the problem: in line else if (retval =3D=3D 0) change it to !=3D 0 =2D-=20 Thiago Macieira - Registered Linux user #65028 thiagom@mail.com =20 ICQ UIN: 1967141 PGP/GPG: 0x6EF45358; fingerprint: E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358 --Boundary-02=_DkRF/r7fiOw7/Gj Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA/FRkDM/XwBW70U1gRAg4mAKC3yoq9NR7OOf2bKuEZ7uBnDgHrPQCZAYab aDWyeYAJMv9Fhp+uO8antlU= =J4HG -----END PGP SIGNATURE----- --Boundary-02=_DkRF/r7fiOw7/Gj-- --===============2059921157632274== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe << --===============2059921157632274==--