From: Yuan X. <xuy...@gm...> - 2007-03-02 11:13:53
|
Hi all, I think the server is OK, since our agent runs OK. And after fixed the bug in GetMessage(), the agentspark runs OK too. My modification is as follows: #------------------------------ #159 unsigned int bytesRead = read(gSocket.getFD(), buffer, sizeof(buffer)); // we may read more than message one time here! --> unsigned int bytesRead = read(gSocket.getFD(), buffer, sizeof(unsigned int)); #190 msgRead += read(gSocket.getFD(), offset, sizeof(buffer) - msgRead); // we may read the data of next message offset += msgRead; --> unsigned int i = read(gSocket.getFD(), offset, msgLen - msgRead); msgRead += i; offset += i; #----------------------------- It is ture that, the orginal agentspark got "large message" while the agentspark do not send msg to server. I think that is beacuse the server runs so fast(faster than communication), and the agent read more message one time(see #159), it will cause the wrong prefixed data. Hope helps! -- Best wishes! Xu Yuan School of Automation Southeast University, Nanjing, China mail: xuy...@gm... xy...@ya... web: http://xuyuan.cn.googlepages.com -------------------------------------------------- |