pBlueG / Socket

Socket plugin for San Andreas Multiplayer
29 stars 15 forks source link

Socket not freed after gamemode restart #4

Open Southclaws opened 9 years ago

Southclaws commented 9 years ago

I posted this on the forum but I figured it would get a better response here.

I've mentioned this before but I will again because it's breaking my server restarts: Every time the server restarts with this plugin, it shows this error: "socket_listen(): Socket has failed to bind. (IP localhost, Port 7778) The port might be already in use." Yes I've called socket_stop_listen and yes I've called socket_destroy on OnGameModeExit. Any other time it works perfectly fine and there are no other programs running on the machine that are taking that port (I checked with netstat).

For now I've added a check on OnGameModeInit that just kills the server (using a crash) if the socket fails to bind. The server does this a few times until finally binding properly. Sending rcon exit or gmx doesn't work, I have to actually crash the server to make this work. I'd love to have a solution to this that doesn't require crashing the server and making it restart 4-5 times before binding properly!

pedropapa commented 9 years ago

confirmed, I have a minigames server and it restarts after each minigame ends, the sockets plugin doesn't work there because of this problem. Hope it gets fixed!

karimcambridge commented 9 years ago

Confirmed, we need this fixed.