int is_reuse_address = 1; ///< when socket close ,after TIME_WAIT close socket
setsockopt(
socket_fd,
SOL_SOCKET,
SO_REUSEADDR,
(const char*)&is_reuse_address,
sizeof(int) );
int is_reuse_address = 1; ///< when socket close ,after TIME_WAIT close socket
setsockopt(
socket_fd,
SOL_SOCKET,
SO_REUSEADDR,
(const char*)&is_reuse_address,
sizeof(int) );
本文标题:socket编程——端口复用
本文链接:https://www.haomeiwen.com/subject/awoiyctx.html
网友评论