T
Timo
Whats wrong with my socket? I can't seem to get read anything from it.
System.out.println(str) and System.out.println("closed") are not
reached/printed.
socket.toString() shows right address, and socket.isConnected() shows true
try {
Socket socket = new Socket(hubAddress, hubPort);
//out = new PrintWriter(socket.getOutputStream());
BufferedReader bout = new BufferedWriter(new
OutputStreamWriter(socket.getOutputStream()));
in = new BufferedReader(new
InputStreamReader(socket.getInputStream()));
hubChat.showMessage(socket.toString() + "\n");
hubChat.showMessage(socket.isConnected() + " <- socket \n");
String str;
while ((str = in.readLine()) != null) {
hubChat.showMessage(str);
System.out.println(str);
}
in.close();
System.out.println("closed");
}
catch (IOException e)
{ e.printStackTrace();
}
}
Here is the connection with telnet:
telnet xxx.xxx.xxx.xxx 411
Trying xxx.xxx.xxx.xxx...
Connected to xxxxxxxxxxxxxxxx (xxx.xxx.xxx.xxx).
Escape character is '^]'.
$Lock 4[7<UR[xcL23Z&;7QS@H(n'Xit(1am^Fh>D=?FK;&XyDj.)Q94xw?'PAU
Pk=qUO<ulaI3R+<.O,k|$HubName FIN / ENG Sauna Hub |<Hub-Security> This hub
is running version 1.0.25 of the NeoModus Direct Connect Hub Software.|
System.out.println(str) and System.out.println("closed") are not
reached/printed.
socket.toString() shows right address, and socket.isConnected() shows true
try {
Socket socket = new Socket(hubAddress, hubPort);
//out = new PrintWriter(socket.getOutputStream());
BufferedReader bout = new BufferedWriter(new
OutputStreamWriter(socket.getOutputStream()));
in = new BufferedReader(new
InputStreamReader(socket.getInputStream()));
hubChat.showMessage(socket.toString() + "\n");
hubChat.showMessage(socket.isConnected() + " <- socket \n");
String str;
while ((str = in.readLine()) != null) {
hubChat.showMessage(str);
System.out.println(str);
}
in.close();
System.out.println("closed");
}
catch (IOException e)
{ e.printStackTrace();
}
}
Here is the connection with telnet:
telnet xxx.xxx.xxx.xxx 411
Trying xxx.xxx.xxx.xxx...
Connected to xxxxxxxxxxxxxxxx (xxx.xxx.xxx.xxx).
Escape character is '^]'.
$Lock 4[7<UR[xcL23Z&;7QS@H(n'Xit(1am^Fh>D=?FK;&XyDj.)Q94xw?'PAU
Pk=qUO<ulaI3R+<.O,k|$HubName FIN / ENG Sauna Hub |<Hub-Security> This hub
is running version 1.0.25 of the NeoModus Direct Connect Hub Software.|