Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import java.net.*;
- public class SocketClient {
- public static void main(String[] args) throws IOException {
- String serverAddress = "127.0.0.1";
- Socket s = new Socket(serverAddress, 5000);
- BufferedReader input =
- new BufferedReader(new InputStreamReader(s.getInputStream()));
- String answer = input.readLine();
- System.out.println("msg from server" + answer);
- System.exit(0);
- }
- }
Add Comment
Please, Sign In to add comment