Change port and handle non-blocking I/O

This commit is contained in:
PeytonPlayz595 2023-12-19 14:28:34 -05:00
parent 87652bc6b5
commit c3faf49aab
2 changed files with 2 additions and 7 deletions

View File

@ -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;

View File

@ -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;
} }