早教吧作业答案频道 -->其他-->
socket结束后如何立刻释放端口-socket的服务端和客户端分别是两个进程使用socketclose后,为何端口不能立即释放,需要等一分钟由系统自动释放.注:linux环境下.注意到手册上对socketclose函数有
题目详情
socket结束后如何立刻释放端口 -
socket的服务端和客户端分别是两个进程使用socket_close后,为何端口不能立即释放,需要等一分钟由系统自动释放.注:linux环境下.注意到手册上对socket_close函数有这样一条评论,With the BSD socket implementation (which is the socket interface used by PHP),a socket_close() may close the socket,but there may yet be data to send.Until the data is sent,the port will not be available.Therefore,all further bindings attempted on that port will not be acceptable due to the \'port can not be reused\' (the approximate message,anyway) error.Ordinarily,if the REUSABLE socket option is set,the only thing that will raise such an error is a binding to a specific IP/PORT combination that is already bound.……究竟该怎么办?
socket的服务端和客户端分别是两个进程使用socket_close后,为何端口不能立即释放,需要等一分钟由系统自动释放.注:linux环境下.注意到手册上对socket_close函数有这样一条评论,With the BSD socket implementation (which is the socket interface used by PHP),a socket_close() may close the socket,but there may yet be data to send.Until the data is sent,the port will not be available.Therefore,all further bindings attempted on that port will not be acceptable due to the \'port can not be reused\' (the approximate message,anyway) error.Ordinarily,if the REUSABLE socket option is set,the only thing that will raise such an error is a binding to a specific IP/PORT combination that is already bound.……究竟该怎么办?
▼优质解答
答案和解析
自己解决了,绑定之前加一个,重用端口socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1)) 查看原帖>>
看了socket结束后如何立刻释放...的网友还看了以下:
连字成词(英语)l u o e b s r u s r e t o s w a e s r t e 2020-05-14 …
一、将下列单词按括号里的部分读音归类(分成十类)aft(er),b(eer),bo(th),b(o 2020-05-15 …
重新排列字母,写出单词1.s,a,p,e,c,2.r,o,e,t,c,k,3.d,c,o,o,t, 2020-06-06 …
重组字母为单词e,e,r,w,he,e,r,t,he,e,se,a,sw,m,s,ir,t,p,i 2020-07-09 …
英语单词填空1.时间状语:d-r-n-2.场所:b-s-s-o-f-r--e-a-t-e-t3.教 2020-07-14 …
排列成正确的句子:me,I,go,excuse,haveto.排列成正确的单词:1.c,d,e,s, 2020-11-01 …
如图,AB是半圆O的直径,以OA为直径的半圆O′与弦AC交于点D,O′E∥AC,并交OC于点E,则下 2020-11-28 …
英语:下1.将下联打乱的字母组成单词,并写出汉语意思1.a,e,h,g,c,n[]2.e,i,s,t 2020-12-10 …
S.O.S的名词解释是什么?S.O.S的名词解释是什么?书上说的什么需要时(限用1次),临时医嘱:1 2020-12-14 …
英文单词分类填空动物类1.O()t()p()s2.k()t()e()3.l()b()t()r4.a( 2021-02-05 …