This problem started today, I programmed a Java file, added a KryoNet server/client into it, when their both (client/server) ran in the same file, it seems to work..
Now im trying to separate them into 2 files (Client.java, Server.java) and it doesn't want to work

As soon as the client Connects, I've tried sending a Packet/Class instantly, thinking that that's what was causing the instant client disconnection, and it isn't.
Servers Console:
1 2 3 4 5
| [Server]: New ServerLogger processed. [Server]: Class registered. [Server]: GServer started: 54555 / 54777. [Server]: A Client has connected. [Server]: A Client has been Disconnected. |
Client Console: (
Where it disconnects..)
1 2 3 4
| [Client]: New ClientLogger processed. [Client]: Class registered. [Client]: GClient started: 1000000, 127.0.0.1, 54555, 54777. Press any key to continue . . . |
Client.java
1 2 3 4 5 6 7 8 9 10 11 12
| public static void main(String[] args) { logger = new ClientLogger("Client"); client = new GClient(TIME_OUT, HOST_ADDRESS, TCP_PORT, UDP_PORT); client.register(client.Packet.class); client.addListener(clientListener = new client.ClientListener()); try { client.start(); } catch (IOException e) { getLogger().log("Unable to connect to: "+HOST_ADDRESS+" / "+TCP_PORT+"!"); System.exit(0); } } |
Server.java
1 2 3 4 5 6 7 8 9 10 11 12
| public static void main(String[] args) { logger = new ServerLogger("Server"); server = new GServer(TCP_PORT, UDP_PORT); server.register(server.Packet.class); server.addListener(serverListener = new server.ServerListener()); try { server.start(); } catch (IOException e) { getLogger().log("Unable to connect to: "+TCP_PORT+" / "+UDP_PORT+"!"); System.exit(0); } } |
I do have classes dedicated to handling the Listeners (both client/server) if you're wondering.
(Maybe I've been programming too much today)
Really hope someone can help.