• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Is network_destroy() the proper way to disconnect from a TCP connection?

kalzme

Member
I've set up a simple nodejs server and a GMS2 client that connects to it.
It seems to be able to connect properly, however, when I disconnect using network_destroy(socket); the nodejs server errors saying read ECONNRESET.

This error indicates that the client abruptly closed the connection.
Because of this I started questioning whether this was the correct way to disconnect.
I feel the documentation on network_destroy is rather vague:
With this function you can remove a network socket connection from your game.
but it sounds like it might indeed close the connection abruptly.

Looking at the documentation I don't seem to be able to find an alternative that would gently close the connection.
So, is network_destroy the proper way to disconnect or is there another way so my nodejs server won't error?
 
Top