stackotter / delta-client

An open source Minecraft Java Edition client built for speed.
https://deltaclient.app
GNU General Public License v3.0
322 stars 33 forks source link

Improve `FlyingSocks`'s synchronous socket API or find a better alternative #151

Closed stackotter closed 1 year ago

stackotter commented 1 year ago

FlyingSocks is the new socket library of choice for Delta Client (after Network.framework could not continue being used due to a lack of Linux support) and its API for synchronous sockets is pretty bad and doesn't completely support Windows when used outside of the package. To improve the API we basically just need to look at how Delta Client is using the API and add methods/initialisers that perform those socket actions in a more streamlined way. If moved inside the FlyingSocks package, all of the things that Delta Client does to use the sockets should work on Windows because the FlyingSocks package imports Windows support at the top of most files (where applicable).

I chose FlyingSocks because it supports Apple platforms, Linux and Windows (all of the other packages I looked at didn't support Windows). The reason that I didn't use SwiftNIO is that its API is completely overcomplicated and I want to get rid of dependence on it in the future because it adds to build times and bloat.

stackotter commented 1 year ago

I've just moved FlyingSocks' Socket api into Delta Client so that I can make as many breaking changes as I want to improve the api. It's so much better. And it seems a lot faster now but I have no clue why.