EsotericSoftware / kryonet

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

discoverHost requires Kryo serialization, but shouldn't #127

Closed erjo1776 closed 6 years ago

erjo1776 commented 7 years ago

Both discoverHost() and discoverHosts() in Client end up calling getKryo() which crashes when your serializer is not based on Kryo.

Probably an easy fix if you change getKryo() to return null for non-Kryo cases. Also, note that onDiscoveredHost() must support a null kryo parameter.

If what I say above is acceptable, then the fix can be made in a minute or two.

I am using JSON serialization because iOS currently chokes on Kyro when using MOE (Multi-OS Engine).