lundi 20 février 2017

ActionScript synax-error

as 2.0 was like java, now in 3.0, I cannot find my error in this code:

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.Socket;
public class Main {
public static void main(String[] args){
String hostName = "localhost";
Int portNumber = 16834;
String str = "starttimer\r\n"; 
try {
    @SuppressWarnings("resource")
    Socket socket = new Socket(hostName, portNumber);
    OutputStreamWriter osw = new <br>OutputStreamWriter(socket.getOutputStream(), "UTF-8");$
    send(str, osw);
} catch (Exception e) {
        System.err.println(e.getMessage());
    }
}
static void send(String str, OutputStreamWriter o) throws IOException {
    o.write(str, 0, str.length());
    o.flush();
}

}
By the way dont worry about where is the data going

Aucun commentaire:

Enregistrer un commentaire