Advertisement
Guest User

Untitled

a guest
Sep 26th, 2012
1,117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. import java.io.*;
  2. import java.net.*;
  3.  
  4. public class SOK_1_CLIENT
  5. {
  6.  
  7. public static void main(String[] args) throws Exception
  8. {
  9. SOK_1_CLIENT CLIENT = new SOK_1_CLIENT();
  10. CLIENT.run();
  11. }
  12.  
  13. public void run() throws Exception
  14. {
  15. Socket SOCK = new Socket("192.159.104.19",444);
  16. PrintStream PS = new PrintStream(SOCK.getOutputStream());
  17. PS.println("Hello to server from client");
  18.  
  19. InputStreamReader IR = new InputStreamReader(SOCK.getInputStream());
  20. BufferedReader BR = new BufferedReader(IR);
  21.  
  22. String MESSAGE = BR.readLine();
  23. System.out.println(MESSAGE);
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement