Open Redarchy opened 3 years ago
Happy and Confused Update :
I think I got the problem. Previously, I had written server.bind(TCP_PORT)
. I changed it to server.bind(TCP_PORT, UDP_PORT)
and got no error with the output of :
00:00 INFO: [kryonet] Server opened. 00:00 INFO: Connecting: /127.0.0.1:80/80 00:00 INFO: [kryonet] Connection 1 connected: /127.0.0.1 00:00 INFO: [kryonet] Connection 1 connected: /127.0.0.1 00:00 INFO: [kryonet] Connection 1 disconnected. 00:00 INFO: [kryonet] Closing server connections... 00:00 INFO: [kryonet] Connection 1 disconnected. 00:00 INFO: [kryonet] Server closed.
If this issue is resolved, don't forget to close it :)
Hi, I'm trying build a simple online game with libgdx and new to networking.
Using these videos to learn how to create a simple client/server connection. I have all the code in the videos properly but when i try to initialize as:
I have the input and the error (as you can see it disconnects immediately after being connected);
1 - When this error happened, I was using this line of code to connect in my client class
client.connect(TIMEOUT, serverIP, TCP_PORT, UDP_PORT);
2 - But after changing it to this, there is no error, no problem :
client.connect(TIMEOUT,serverIP,TCP_PORT);
Like I said, I'm a newbie to networking and I did not understand the problem here. I think I solved it only not using UDP Port but still not understand what is wrong when i used UDP.
Also, my port variables are : TCP : 80 and UDP : 6672. Tried with different UDP Port numbers but still the same error.
Thanks for any helps and given clues.