[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KExtendedSocket & waitForMore
From:       Thiago Macieira <thiagom () wanadoo ! fr>
Date:       2003-07-16 9:21:01
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Kostko wrote:
>I have the folowing code:
>
>// ...
>writeBlock(cmd.latin1(), cmd.length());
>int readBytes = 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 
might be the cause of your problem.

In KExtendedSocket::waitForMore, please try this and report to me if it solves 
the problem: in line
  else if (retval == 0)
change it to != 0

-- 
  Thiago Macieira  -  Registered Linux user #65028
   thiagom@mail.com           
    ICQ UIN: 1967141   PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic