开发者

c++ Release udp port which is in use

开发者 https://www.devze.com 2023-04-10 18:12 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号