Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cliente x Server Serialization
Message
From
01/11/2002 09:34:25
 
 
To
All
General information
Forum:
Java
Category:
Other
Title:
Cliente x Server Serialization
Miscellaneous
Thread ID:
00717777
Message ID:
00717777
Views:
34
Hi everybody!
I am writing a client/Server aplication to exchange security messages from clients connected to the Server.
I am sending all messages in a Serializable Object called Mensagem.
The problem is:
When the cliente writes on The ObjectOutPutStream I can only send all objects that I wrote to the Stream only if I CLOSE the Stream. (but this kill my client).

I have tryed to use the flush() method but it doesn't work.
Any one can help?

Here is my Preliminaary Test Code.

public class cliente
{
public static void main(String[] Args)
{
try
{
Socket minha_socket = new Socket("127.0.0.1",171) ;
ObjectOutputStream oos = new ObjectOutputStream(minha_socket.getOutputStream()) ;
Autenticacao aut = new Autenticacao("Flavio Henrique") ;
Mensagem msg = new Mensagem() ;
msg.setEmissor("Emissor") ;
msg.setDestino("Destino") ;
msg.setMensagem("Eu te amo") ;
oos.writeObject(aut) ;
oos.writeObject(msg) ;
oos.close() ; // kill my conection but send all the objects
// oos.flush() ; // doesn't work
}
catch(Exception e)
{
System.out.println(e.getMessage()) ;
}
}
}
Reply
Map
View

Click here to load this message in the networking platform