1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
try
{
Socket s = new Socket(InetAddress.getByName("localhost"),1311);
PrintStream output = new
BufferedReader client = new BufferedReader(new InputStreamReader(s.getInputStream()));
System.out.println(s.getInputStream());
try {
String msg_String = client.readLine();
System.out.println("String from the client : " + msg_String.toString());
}
catch (IOException e) {
System.out.println("Couldn't get I/O for the connection to: ");
}
}catch(Exception e)
{
e.printStackTrace();
} |
Partager