Change port and handle non-blocking I/O
This commit is contained in:
parent
87652bc6b5
commit
c3faf49aab
|
@ -139,7 +139,7 @@ public class MinecraftServer implements Runnable {
|
|||
}
|
||||
|
||||
public void run() {
|
||||
logger.info("Now accepting input on 8080");
|
||||
logger.info("Now accepting input on 25565");
|
||||
int var1 = 50000000;
|
||||
int var2 = 500000000;
|
||||
|
||||
|
|
|
@ -69,7 +69,6 @@ public class WebSocketChannel {
|
|||
|
||||
server.setHandler(context);
|
||||
server.start();
|
||||
server.join();
|
||||
}
|
||||
|
||||
public void stopServer() {
|
||||
|
@ -112,11 +111,7 @@ public class WebSocketChannel {
|
|||
if (sessionBytesToWrite > 0) {
|
||||
byte[] data = new byte[sessionBytesToWrite];
|
||||
buffer.get(data);
|
||||
try {
|
||||
session.getRemote().sendBytes(ByteBuffer.wrap(data));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
session.getRemote().sendBytesByFuture(ByteBuffer.wrap(data));
|
||||
}
|
||||
bytesToWrite += sessionBytesToWrite;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user