Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1.     private MinecraftPingReply getPing(String host, int port, int timeout) throws IOException {
  2.             final Socket socket = new Socket();
  3.             sockets.add(socket);
  4.             socket.setSoTimeout(timeout);
  5.             socket.connect(new InetSocketAddress(host, port), timeout);
  6.  
  7.             final DataInputStream in = new DataInputStream(socket.getInputStream());
  8.             final DataOutputStream out = new DataOutputStream(socket.getOutputStream());
  9.  
  10.             //> Handshake
  11.  
  12.             ByteArrayOutputStream handshake_bytes = new ByteArrayOutputStream();
  13.             DataOutputStream handshake = new DataOutputStream(handshake_bytes);
  14.         ....
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement