Only one usage of each socket address (protocol/network/address/port) is norma

Previous topic - Next topic

MrTAToad

Having receiving this message after every second go through with my game, it took me half a day to work out the cause (would have been a bit quicker, but Star Trek must be seen).

It actually turns out to be caused, for some reason, by NETWEBGET...

After the game finishes, the socket system (I'm using UDP) is shut down (close the socket first and then the socket system), but almost directly after that I use NETWEBGET to upload potential hiscores.

As it stands, third time around I get the message as stated in the title when calling UDPOPEN (and Windows's netstat command shows the port I use - 50130 is still in use)

So after getting rid of all the messaging systems, changing default states I suddenly realised the problem only occured when the "game over" routine is called.  So, start eliminating everything in there, and the only thing left is NETWEBGET...  Eliminate that and all is okay.

So, in the end, I decided to put in a call to SOCK_SHUTDOWN and NETSHUTDOWN and that seems to have solved the problem.


Hemlos

I dont think NETWEBGET is intended to be used with the other NET commands.
It is standalone, and doesnt need the sock library.

This isnt noted in the manual, perhaps it should be.
Bing ChatGpt is pretty smart :O

MrTAToad

QuoteI dont think NETWEBGET is intended to be used with the other NET commands.
It certainly looks that way.

Quoteis this on Win32 only, or pehaps on Linux as well?
I actually had the problem with Windows and Mac - Linux gets left to last for all testing :)