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

Allow option of using Memory mapped file(s) instead of direct buffers #121

Open ivansenic opened 7 years ago

ivansenic commented 7 years ago

Hi,

We are using kryonet for some time now in our project. However, we could not afford to have limited byte buffers for read/write in TCP Connections, as we are sending objects that follow the composite pattern, so object sizes are not fixed and predicable in fact. So we tweaked a bit the code and tried to added ability to overcome this, but we just figured out that we did it wrong in a way and that client server communication is a bottleneck for us, especially when there are two or more clients connected.

So I am trying once again to figure out how to improve our own mistakes and one idea came to my mind and that's: Why not allowing users to initialize the client and/or server with mapped byte buffers pointing to the memory mapped files, instead of the direct buffers?

The benefits would be following:

What do you think, did I not consider something here? If you think this is valid option, I have nothing against in providing the pull request, I would just need some agreement on how to implement it.

crykn commented 6 years ago

Sounds like a good change! Are you still interested in implementing it or have done it already?

ivansenic commented 6 years ago

Hi @crykn,

Unfortunately in our project we decided to go away from kryonet. Thus I can not provide you any support here as simply I don't have for it. If this changes in future I will let you know. Sorry but I posted this almost a year ago :smile:

crykn commented 6 years ago

No problem, it was worth a try asking ;)