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 bug-commoncpp@gnu.org, please tell me where is a new
mailing list, of group....)
Carlo





_______________________________________________
Bug-commoncpp mailing list
Bug-commoncpp@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-commoncpp

Reply via email to