I followed this Youtube tutorial , which covers the basics of Cryonet.
Basically this is Kryonet's Hello World, it explains how to configure the base server and client, allowing the client to send packets to the server and have a very basic connection.
Link to the source code . Both server and client have the same package class.
I can start the server, and the Client requests an IP connection. However, when I enter IP, the Client ends immediately 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)
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 that the system is closing the TCP connection, but I really don't know. Do I have to enable something on a Windows or / or router to allow Kryonet communication?
Can anyone spot the problem? Thanks in advance.
The line displayed in Spanish in the command line log is something like "Terminating an existing connection was forcibly deleted using the remote host."
EDIT after user 1816380:
In most cases, 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.
source share