dcsimg
writing and reading objects from the socket stream
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ajith_Vadakut
Posted On:   Thursday, February 12, 2004 10:38 PM

I have created a client server (ServerSocket) application. It works the following way : Server waits for client's request. Once accepted a client socket created and a thread takes care of communicating to the client. The Client on establishing the connection : sends an object to server The server first accepts an object and then ack the client. the client reads the ack and prints it on screen. The client would then send the second object. The problem : The Server reads the first object and prints its contents correctly. But when the second object is sent to the server, i find the server still printing the first received objects contents. I have used flush() method.    More>>

I have created a client server (ServerSocket) application.
It works the following way :
Server waits for client's request. Once accepted a client socket created and a thread takes care of communicating to the client.
The Client on establishing the connection : sends an object to server
The server first accepts an object and then ack the client.
the client reads the ack and prints it on screen. The client would then send the second object.

The problem : The Server reads the first object and prints its contents correctly.

But when the second object is sent to the server, i find the server still printing the first received objects contents.

I have used flush() method.

Kindly tell me what could be the problem ?

Thanking you all !!!

   <<Less

Re: writing and reading objects from the socket stream

Posted By:   Mark_Stewart  
Posted On:   Sunday, March 28, 2004 09:04 AM

It has to do with the object you are sending, it sounds as though your sending a class object and once the class is loaded the first time, it only ever uses that object, but if thats is not the case tell me what you are sending and I should be able to help.
About | Sitemap | Contact