Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cliente x Server Serialization
Message
De
01/11/2002 09:34:25
 
 
À
Tous
Information générale
Forum:
Java
Catégorie:
Autre
Titre:
Cliente x Server Serialization
Divers
Thread ID:
00717777
Message ID:
00717777
Vues:
35
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()) ;
}
}
}
Répondre
Fil
Voir

Click here to load this message in the networking platform