[KryoNet failure, client connects, than disconnects]

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 :frowning:
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:


[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…)


[Client]: New ClientLogger processed.
[Client]: Class registered.
[Client]: GClient started: 1000000, 127.0.0.1, 54555, 54777.
Press any key to continue . . .

Client.java


	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


	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.

Probably you send too much to the client / to the server. Make sure that the data you send isn’t too large and you don’t send it in a small delay.

I’m not even sending anything, and even when i do send/recieve in my working example, i can send 10MB++ in under a few seconds.
That’s not the problem here.