c++ Release udp port which is in use
I am currently working on an add-on for a dedicated server of halo, however the server tends to crash every now and then and the port stays in use.
So when the program is restarted after a crash it doesn't transmit any information internally (localhost) or over the internet.
What we could do is add a function to our addon that automatically Releases/makes the port available at the start of the program and then let the program initialize it self again so it works fine.
However we have no knowledge about udp or network programming in c++ at this moment, so we are basically asking if someone knows if this is possible(or some other way of fixing thi开发者_如何学JAVAs problem) and how to make this in c++ for windows.
We already googled some but couldn't find anything useful.
The program should use the socket option SO_REUSEADDR, this will allow using the socket after program restart.
精彩评论