“I have a simple client running and it connects to my server; however, after connecting i cant receive back any data. I’m guessing something needs to be put into a while loop so the thread doesnt finish but i dont know what to put in it. Can someone help me out or give me a clue please?
Thread background=new Thread(new Runnable() {
public void run() {
try {
socket = new Socket("255.255.255.255", 9999);
dataOutputStream = new DataOutputStream(socket.getOutputStream());
dataInputStream = new DataInputStream(socket.getInputStream());
dataOutputStream.writeUTF("Send this text to the server");
Log.i("Appname", dataInputStream.readUTF());
} catch (someexceptionhere) {
}
}
});
I scrapped the way I was receiving and i’m using:
Seems to work now thx