public class glowna {
String message = "witaj";
public static void main(String[] args) {
glowna pomocnicza = new glowna();
pomocnicza.echo("localhost");
}
public void echo(String host){
try{
Socket gniazdo = new Socket(host, 135);
BufferedReader in = new BufferedReader(new InputStreamReader(gniazdo.getInputStream()));
PrintWriter out = new PrintWriter(gniazdo.getOutputStream());
out.print(message);
out.flush();
String reply = in.readLine();
System.out.println("wyslano " + message );
System.out.println("odebrano " + reply );
gniazdo.close();
}
catch(IOException e){
System.out.println("Blad "+e);
}
}
}
Czemu program nie moze nawiazac polaczenia?