创建套接字
绑定端口
连接服务器。//这一步。
传输数据。
我想释放当前已经connect()好的链接而不关闭套接字,如何?
10 个解决方案
#1
Connection-oriented sockets such as SOCK_STREAM provide full-duplex connections, and must be in a connected state before any data can be sent or received on it. A connection to another socket is created with a connect call. Once connected, data can be transferred using send and recv calls. When a session has been completed, a closesocket must be performed.
感覺是必須的,呵呵。
感覺是必須的,呵呵。
#2
、、、关闭连接的做法就是 关闭套接字啊 额、、
#3
关闭套接字,创建套接字很麻烦吗?
#4
我们一般通过关闭套接字来关闭已建立的连接,帮LZ顶一个~
#5
只能关闭 套接字。
#6
你这问题问的就好比我问你:你开车的时候不踩刹车如何让车停下来?难道去撞墙?
#7
closesocket()关闭套接字以后就释放了连接
#8
The shutdown function disables sends or receives on a socket.
=======================================================
FreeLaxy, your backup.
=======================================================
=======================================================
FreeLaxy, your backup.
=======================================================
#9
释放套接字必须调用closesocket,就想你打开了一个文件,必须要关闭一样。
#10
不关闭连接,重新使用套接字与另外一个服务器建立一个新连接,不可以吗?
#1
Connection-oriented sockets such as SOCK_STREAM provide full-duplex connections, and must be in a connected state before any data can be sent or received on it. A connection to another socket is created with a connect call. Once connected, data can be transferred using send and recv calls. When a session has been completed, a closesocket must be performed.
感覺是必須的,呵呵。
感覺是必須的,呵呵。
#2
、、、关闭连接的做法就是 关闭套接字啊 额、、
#3
关闭套接字,创建套接字很麻烦吗?
#4
我们一般通过关闭套接字来关闭已建立的连接,帮LZ顶一个~
#5
只能关闭 套接字。
#6
你这问题问的就好比我问你:你开车的时候不踩刹车如何让车停下来?难道去撞墙?
#7
closesocket()关闭套接字以后就释放了连接
#8
The shutdown function disables sends or receives on a socket.
=======================================================
FreeLaxy, your backup.
=======================================================
=======================================================
FreeLaxy, your backup.
=======================================================
#9
释放套接字必须调用closesocket,就想你打开了一个文件,必须要关闭一样。
#10
不关闭连接,重新使用套接字与另外一个服务器建立一个新连接,不可以吗?