I followed this Youtube tutorial covering the basics of Kryonet.
Basically it is a Kryonet Hello World, it explains how to setup a basic Server and a Client, allowing the Client to send Packets to the Server and have very basic communication.
A link to the source code. Both Server and Client have the same Packet class.
I can get the Server running, and the Client asking the IP to connect. However when i enter the IP, the Client terminates just after connecting.
Client output:
00:03 INFO: Connecting: /127.0.0.1:54555
00:03 INFO: [kryonet] Connection 1 connected: /127.0.0.1
00:03 INFO: [CLIENT] You have connected.
BUILD SUCCESSFUL (total time: 3 seconds)
The Server command line Log:
00:00 INFO: [kryonet] Server opened.
00:04 DEBUG: [kryonet] Port 54555/TCP connected to: /127.0.0.1:53217
00:04 DEBUG: [kryo] Write: RegisterTCP
00:04 INFO: [kryonet] Connection 1 connected: /127.0.0.1
00:04 INFO: [SERVER] Someone has connected.
00:04 DEBUG: [kryonet] Connection 1 update: Se ha forzado la interrupcion de una
conexion existente por el host remoto
00:04 INFO: [SERVER] Someone has disconnected.
00:04 INFO: [kryonet] Connection 1 disconnected.
It seems like the system closes the TCP connection, but i don't really know. Must i enable something in Windows or/and router to permit communication of Kryonet?
Can somebody spot the problem? Thanks in advance.
The line that appears in spanish in the command line log is something like "An interruption of an existant connection has been forced by the remote host."
EDIT after user1816380 advice:
Most of times it still shows the original error, but from time to time you can see:
00:00 INFO: [kryonet] Server opened.
00:07 DEBUG: [kryonet] Port 54555/TCP connected to: /127.0.0.1:50787
00:07 DEBUG: [kryo] Write: RegisterTCP
00:07 INFO: [kryonet] Connection 1 connected: /127.0.0.1
00:07 INFO: [SERVER] Someone has connected.
00:07 DEBUG: [kryo] Read: Packet0LoginRequest
00:07 DEBUG: [kryonet] Connection 1 received TCP: Packet0LoginRequest
00:07 DEBUG: [kryo] Write: Packet1LoginAnswer
00:07 DEBUG: [kryonet] Connection 1 sent TCP: Packet1LoginAnswer (6)
00:07 DEBUG: [kryonet] Connection 1 update: Se ha forzado la interrupcion de una
conexion existente por el host remoto
00:07 INFO: [SERVER] Someone has disconnected.
00:07 INFO: [kryonet] Connection 1 disconnected.