Posted By:
Carfield_Yim
Posted On:
Friday, February 15, 2002 08:35 AM
HI, I have write a socket client-server, that a client will transfer an object to server, then the server do some processing on that object and then broadcast to all clients. I have verify that the server have receive client object and process it successfully. However when the server broadcast the object to client, the client just receive a empty data structure, i.e.: The object exist but all element of that object are removed. I try many ways and still can't find the solution, then I try the following codes at server: clientObj.clear(); clientObj.putAll(serverObj); serverObj = clientObj; And it work. Now the client can receive a boardcasted object
More>>
HI, I have write a socket client-server, that a client will transfer an object to server, then the server do some processing on that object and then broadcast to all clients.
I have verify that the server have receive client object and process it successfully. However when the server broadcast the object to client, the client just receive a empty data structure, i.e.: The object exist but all element of that object are removed.
I try many ways and still can't find the solution, then I try the following codes at server:
clientObj.clear();
clientObj.putAll(serverObj);
serverObj = clientObj;
And it work. Now the client can receive a boardcasted object with element. Why will this happen? Besides, now I encounter the other problem, actually the data-structure of that object is a tree with 3 level. I find that the boardcast object received is only have 2 level.
Do anyone encounter similar problem?
<<Less