Weak question, I use BCB6.0 + Winsock's network communication program, why can't the client port cannot be reused, dep

xiaoxiao2021-03-06  15

Is it TCP, port multiplexing should be set with setsockopt

Bool optval = true;

Socket m_socket;

Setsockopt (m_socket, ipproto_tcp, so_reuseaddr, (char far *) & optval, sizeof (optval));

Now, if you do not specify a port, each client sends a data, establish 2 TCP connections, a listening, an eStabLished, if you send a tens of thousands of messages, that port is not enough .... If the port is specified, the first message can be sent out, but the second section can not be sent, the error port is occupied, the estimated port multiplexing is still problematic, and I use TCP is not the second parameter should be set to

Ipproto_tcp? When did you use SOL_Socket?

Please also ask you a cattle

转载请注明原文地址:https://www.9cbs.com/read-48661.html

New Post(0)