EsotericSoftware / kryonet

TCP/UDP client/server library for Java, based on Kryo
BSD 3-Clause "New" or "Revised" License
1.81k stars 416 forks source link

Client Disconnected without Exception on localhost UDP #94

Closed Rolleander closed 8 years ago

Rolleander commented 9 years ago

After debugging for a while i finally found the reason my client crashed: Because I used connection.sendUDP() on my server, while working on localhost. This resulted in a client connection lost with no exceptions appearing from kryonet, so I had to debug every step until I found this. (The server just said client disconnected). Now I know you cant send UDP to localhost, but maybe throwing an exception in KryoNet would be nice.

NathanSweet commented 9 years ago

There's no problem sending UDP to localhost. See PingPongTest and others.

Rolleander commented 9 years ago

Hmmm, sending from my server with udp to my clients doesnt work. Maybe I have a wrong UDP port, that doesnt work on localhost.

Rolleander commented 9 years ago

I noticed only the server cant send via UDP to the client (both on localhost). The clients sendUDP to the server works. But it still crashes if the server tries to send UDP. (with TCP it doesnt happen).