dimanche 23 décembre 2018

How to fix that If get's ignored in while

I want to program a crude http client to send some weather data from a to b but in an important while loop the if statement get's ignored

SocketServer.stringOut = "test message";
SocketServer.send = true;
while (true){
    SocketServer.stringIn = inputReader.readLine();
    if(SocketServer.send){
    System.out.println("SENDING TEXT MESSAGE");
        outputWriter.println(SocketServer.stringOut);
        SocketServer.send = false;
    }
}

Aucun commentaire:

Enregistrer un commentaire