This is my problem: I need a message to be sent by a socket repeatedly, to do this, I created another Thread, so that the application would not be locked, so:
new Thread(new Runnable(){
public void run(){
try{
Socket s = new Socket("127.0.0.1",12739);
DataOutputStream dos = new DataOutputStream(s.getOutputStream());
while(true){
s.writeUTF("Isso é um teste");
s.flush();
}
} catch(IOException e){}
}
});
The problem begins when the message "This is a test" appears only once, and then does not appear any more, can someone help me?