socket re-connection problem# Programming - 葵花宝典
mw
1 楼
Now i have a TCP/IP, server program. It uses its ip address and port number to
bind a socket ,then listen and connect.
The problem is , after the client side is shutdown, it needs to re-connect.
But after I "closesocket", how can i re-setup this connection ?
My process is "open socket again" ->setsockopt->bind, but the "bind" just
fails and complains that the port is in use. Wierd! I have already shutdown
the socket use "closesocket", there should not be such problem at all...
can anyone help?
t
bind a socket ,then listen and connect.
The problem is , after the client side is shutdown, it needs to re-connect.
But after I "closesocket", how can i re-setup this connection ?
My process is "open socket again" ->setsockopt->bind, but the "bind" just
fails and complains that the port is in use. Wierd! I have already shutdown
the socket use "closesocket", there should not be such problem at all...
can anyone help?
t