bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug on isPending(Socket::pendingInput) and buffer reading (REPLY PLEASE!


From: Wakan
Subject: bug on isPending(Socket::pendingInput) and buffer reading (REPLY PLEASE!!!)
Date: Wed, 21 Feb 2007 21:44:13 +0100
User-agent: Mozilla Thunderbird 1.5.0.9 (Windows/20061207)

I'm using this piece of code (a client):
       TCPStream tcp(addr,4096,512);
        .....
                   tcp << "B";         // send to the server
                   tcp << level;
                   tcp << "0384";
tcp.write(row[3],tpl_size);
                   tcp << endl;
      ......
if(tcp.isPending(Socket::pendingInput,50000)) { tcp >> ris; // read server reply
                       ....
                  }

What I notice (after long time I was having this problem, but not knowing why): After about 10hrs of work (but not on all clients...it happens randomly), it happens that this client gets the server reply, but it's the previouos server reply!...not what the server writes NOW on the socket (I can see what the server writes), but the PREVIOUS reply.......the server writes 1000, 1001, 1002.....the client reads 0999, 1000, 1002 starting from
an random moment (after some hours) on...
In this situation I see that in the output of a 'netstat -anp', the Recv-Q buffer of the client side connection contains something (6 bytes),
even after a reading.
On the next write/read cycle, there still remain 6 bytes in the Recv-Q and so on...
Is there a way to empty the buffer?
Why the tcp >> ris; don't put all the Recv-Q content in ris, but leaves something?
Please, help me...I'm desperate...
(If I'm mistaking on writing here, to address@hidden, please tell me where is a new
mailing list, of group....)
Carlo







reply via email to

[Prev in Thread] Current Thread [Next in Thread]