I'm making simple Godot project that works with Node.js server. To receive and send packet to Node.js server, I used StreamPeerTCP.

First seems works, but after 2nd transmission from server, extract data from packet were broken and mess all other logics.

This wasn't happened when same logic tested with Unity C#: https://github.com/rico345100/unity-multiplayer-with-nodejs/blob/master/Assets/Scripts/Network/NetworkManager.cs

Here's the repo I'm currently developing: https://github.com/rico345100/godot-multiplayer-with-nodejs https://github.com/rico345100/nodejs-tcp-server-for-godot

Used Godot 3.1.2 but also works with 3.2.rc6. Tested with Godot 3.1.2 and macOS 10.13.6.

  • 2
    \$\begingroup\$ Broken how? What did the server send, and what did you get instead? \$\endgroup\$ – rcorre Jan 29 at 12:09
  • 1
    \$\begingroup\$ Please include in your question itself a Minimal Complete Verifiable Example of the problem that does not rely on visiting GitHub. This helps keep your question clear even if the contents of those repositories change in future. \$\endgroup\$ – DMGregory Jan 29 at 12:58
  • \$\begingroup\$ TCP transmits bytes, not packets. You can send one chunk of bytes and it could be split up into two. Or you could send two chunks and receive one big one. \$\endgroup\$ – user253751 Jan 29 at 15:52
  • \$\begingroup\$ Thanks for sharing your github. I do agree this need Minimal Complete Verifiable Example though. \$\endgroup\$ – Clemens Tolboom Feb 21 at 9:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.