-
Notifications
You must be signed in to change notification settings - Fork 393
Network API #12
Comments
@NiLSPACE Oh this should be way better. We didn't notice that when we started Dockercraft (back in June). We should definitely use the network API instead of webadmin. |
I believe it was implemented somewhere in January. It's possible you guys saw an old post on the forum where people asked for a network API. |
@NiLSPACE Maybe... anyway this is great news! Let's get rid of this weird webadmin usage! :) |
I started to work on some implementation using cNetwork plugin. It's going to clean the code a lot! :) |
@gdevillele @dave-tucker Just so you know, I'm still working on this one. Implementation should be ok on Dockercraft side. But I still have issues with the TCP connection, and it seems to be due to cNetwork issues... For example, reading in TCP connection is not blocking, cNetwork plugin answers with empty byte arrays when there's nothing to answer. And at some point I get |
@NiLSPACE Yes, I'm investigating. I wanna be sure it's not because of one of my own mistakes. But I'll report issues to Cuberite and help fixing them as much as I can! Thanks for the links! |
Note that the network API is designed to be non-blocking - Cuberite plugins cannot afford to block for IO, because they hold a mutex to the entire world. You'll need to design the protocol to be async-aware. Usually we do that by caching the received responses until they contain enough data to be parsed as a chunk; then process the data and keep the rest in the incoming buffer, etc. I'm still wondering, with the |
@madmaxoft Yes I understand all Cuberite plugins have to be non-blocking. |
There is also a higher level client you can use: https://api.cuberite.org/cUrlClient.html |
Hello,
I saw you guys are using the webadmin from Cuberite even though Cuberite has a network API. Was there a reason to choose the webadmin over that?
The documentation for it is here: http://apidocs.cuberite.org/cNetwork.html
The text was updated successfully, but these errors were encountered: