Guest User

Untitled

a guest
May 26th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. package client;
  2.  
  3. import java.io.IOException;
  4. import java.net.ServerSocket;
  5. import java.net.Socket;
  6. import java.sql.Connection;
  7.  
  8. public class TestServer {
  9.  
  10. /**
  11. * @param args
  12. * @throws IOException
  13. * @throws InterruptedException
  14. */
  15. public static void main(String[] args) throws IOException, InterruptedException {
  16. // TODO Auto-generated method stub
  17. Socket socket = null;
  18. ServerSocket server = null;
  19. byte[] ip = new byte[] {1,2,3,4,5};
  20. server = new ServerSocket(42424);
  21. socket = server.accept();
  22.  
  23. while (socket.isConnected()) {
  24. // Thread.sleep(5000);
  25. // socket.getOutputStream().write(ip);
  26. Thread.sleep(2000);
  27. socket.getOutputStream().write(518);
  28. socket.getOutputStream().write(15);
  29. }
  30. // socket.close();
  31. // server.close();
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment