Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private MinecraftPingReply getPing(String host, int port, int timeout) throws IOException {
- final Socket socket = new Socket();
- sockets.add(socket);
- socket.setSoTimeout(timeout);
- socket.connect(new InetSocketAddress(host, port), timeout);
- final DataInputStream in = new DataInputStream(socket.getInputStream());
- final DataOutputStream out = new DataOutputStream(socket.getOutputStream());
- //> Handshake
- ByteArrayOutputStream handshake_bytes = new ByteArrayOutputStream();
- DataOutputStream handshake = new DataOutputStream(handshake_bytes);
- ....
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement