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() {
|
public void run() {
|
||||||
logger.info("Now accepting input on 8080");
|
logger.info("Now accepting input on 25565");
|
||||||
int var1 = 50000000;
|
int var1 = 50000000;
|
||||||
int var2 = 500000000;
|
int var2 = 500000000;
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,6 @@ public class WebSocketChannel {
|
||||||
|
|
||||||
server.setHandler(context);
|
server.setHandler(context);
|
||||||
server.start();
|
server.start();
|
||||||
server.join();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopServer() {
|
public void stopServer() {
|
||||||
|
@ -112,11 +111,7 @@ public class WebSocketChannel {
|
||||||
if (sessionBytesToWrite > 0) {
|
if (sessionBytesToWrite > 0) {
|
||||||
byte[] data = new byte[sessionBytesToWrite];
|
byte[] data = new byte[sessionBytesToWrite];
|
||||||
buffer.get(data);
|
buffer.get(data);
|
||||||
try {
|
session.getRemote().sendBytesByFuture(ByteBuffer.wrap(data));
|
||||||
session.getRemote().sendBytes(ByteBuffer.wrap(data));
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
bytesToWrite += sessionBytesToWrite;
|
bytesToWrite += sessionBytesToWrite;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user