- 浏览: 218291 次
- 性别:
- 来自: 武汉
文章分类
- 全部博客 (110)
- java (111)
- c# winform tablelayoutpanel学习 合并行的布局及动态增加删除内部控件 (1)
- javascript常用正则 (1)
- 认识Java程序 (1)
- UniqTask for android (1)
- JAX-RS 从傻逼到牛叉 2:开发一个简单的服务 (1)
- Spring MVC 数据绑定的扩展 (1)
- 手机分辨率 (1)
- tomcat的favicon.ico的用法 (1)
- Cookie读写demo (1)
- hive相关操作文档收集 (1)
- 测试开发工程师的发展 (1)
- JSF入门十(自定义转换器) (1)
- 《你能行:微软精英的职场心里话》 (1)
- JNI程序如何检测C代码的内存泄漏 (1)
- 做了几天的调研工作 (1)
- 使用Microsoft Web Application Stress进行压力测试 (1)
- 在线共享音乐吧(Online Share Music Bar)解决方案 (1)
- 如何二次压缩RM和RMVB格式文件 (1)
- 突然想起了红色联盟 就去看了看 (1)
- 推荐两个关于DB2认证的站点 (1)
- 安装Microsoft .NET Framework SDK 快速入门、教程和示例 (1)
- 去掉C/C++程序代码中的注释 (1)
- 数据结构之kmp模式匹配 (1)
- JS跨域 (1)
- SP2-0734: 未知的命令开头 "exp test/t..." - 忽略了剩余的行 解决办法 (1)
- Android开发之fedora13下编译Android源码 (1)
- Android开发之Linkify (1)
- json学习之三:JSONArray的应用 (1)
- js 数组操作代码集锦 (1)
- jquery跨域调用json数据 (1)
- qtdemo浅析 (1)
最新评论
-
songshuang:
最近怎么都盗我的文
做个小调查,程序员们都是什么星座的?
在网络编程中,特别是在短时间内new的网络连接太多,经常出现java.net.bindexception: addressalready in use:jvm_bind的异常,网络有很多介绍此异常的,通常都是在说是要使用的端口被别的程序已经使用,但有时并不是这个原因,通过仔细查找,找到一些很好的资料,在此将其一一记录下来。<br> <br> <br>**********************************************************************************<br>文章一<br> <br> 短时间内new socket操作过多<br> 而socket.close()操作并不能立即释放绑定的端口<br> 而是把端口设置为time_wait状态<br> 过段时间(默认240s)才释放(用netstat -na可以看到)<br> 最后系统资源耗尽<br> (windows上是耗尽了pool of ephemeral ports这段区间在1024-5000之间)<br> socket faq:<br> remember that tcp guarantees all datatransmitted will be delivered,<br>if at all possible. when you close a socket, the server goes intoa<br>time_wait state, just to be really really sure that all the datahas<br>gone through. when a socket is closed, both sides agree bysending<br>messages to each other that they will send no more data. this,it<br>seemed to me was good enough, and after the handshaking is done,the<br>socket should be closed. the problem is two-fold. first, there isno<br>way to be sure that the last ack was communicatedsuccessfully.<br>second, there may be "wandering duplicates" left on the net thatmust<br>be dealt with if they are delivered.
andrew gierth (<span style="color: #336699;">andrew@erlenstar.demon.co.uk</span>) helped toexplain the<br>closing sequence in the following usenet posting:
assume that a connection is in established state, and the clientis<br>about to do an orderly release. the client's sequence no. is sc,and<br>the server's is ss. client server<br>====== ======<br>established established<br>(client closes)<br>established established<br> <br>resolution<br>warning serious problems might occur if you modify the registryincorrectly by using registry editor or by using another method.these problems might require that you reinstall your operatingsystem. microsoft cannot guarantee that these problems can besolved. modify the registry at your own risk.<br>the default maximum number of ephemeral tcp ports is 5000 in theproducts that are included in the 'applies to' section. a newparameter has been added in these products. to increase the maximumnumber of ephemeral ports, follow these steps: 1. start registryeditor.<br>2. locate the following subkey in the registry, and then clickparameters:<br>hkey_local_machine\system\currentcontrolset\services\tcpip\parameters<br>3. on the edit menu, click new, and then add the following registryentry:<br>value name: maxuserport<br>value type: dword<br>value data: 65534<br>valid range: 5000-65534 (decimal)<br>default: 0x1388 (5000 decimal)<br>description: this parameter controls the maximum port number thatis used when a program requests any available user port from thesystem. typically , ephemeral (short-lived) ports are allocatedbetween the values of 1024 and 5000 inclusive.<br>4. quit registry editor.
note an additional tcptimedwaitdelay registry parameterdetermines how long a closed port waits until the closed port canbe reused.
原文连接:<span style="color: #336699;">http://blog.chinaunix.net/u/29553/showart_450701.html</span>
**********************************************************************************<br>文章二
java.net.bindexception: address already in use: connect的问题<br>大概原因是短时间内newsocket操作很多,而socket.close()操作并不能立即释放绑定的端口,而是把端口设置为time_wait状态,过段时间(默认240s)才释放,(用netstat-na可以看到),最后系统资源耗尽(windows上是耗尽了pool of ephemeral ports,这段区间在1024-5000之间; )
避免出现这一问题的方法有两个,一个是调高你的web服务器的最大连接线程数,调到1024,2048都还凑合,以resin为例,修改resin.conf中的thread-pool.thread_max,如果你采用apache连resin的架构,别忘了再调整apache;
另一个是修改运行web服务器的机器的操作系统网络配置,把time wait的时间调低一些,比如30s。<br>在red hat上,查看有关的选项,<br>[xxx@xxx~]$ /sbin/sysctl -a|grep net.ipv4.tcp_tw<br>net.ipv4.tcp_tw_reuse = 0<br>net.ipv4.tcp_tw_recycle = 0<br>[xxx@xxx~]$vi /etc/sysctl,修改<br>net.ipv4.tcp_tw_reuse = 1<br>net.ipv4.tcp_tw_recycle = 1<br>[xxx@xxx~]$sysctl -p,使内核参数生效
<br>socket-faq中的这一段讲time_wait的,摘录如下:<br>2.7. please explain the time_wait state.
remember that tcp guarantees all data transmitted will bedelivered,<br>if at all possible. when you close a socket, the server goes intoa<br>time_wait state, just to be really really sure that all the datahas<br>gone through. when a socket is closed, both sides agree bysending<br>messages to each other that they will send no more data. this,it<br>seemed to me was good enough, and after the handshaking is done,the<br>socket should be closed. the problem is two-fold. first, there isno<br>way to be sure that the last ack was communicatedsuccessfully.<br>second, there may be "wandering duplicates" left on the net thatmust<br>be dealt with if they are delivered.
andrew gierth (<span style="color: #336699;">andrew@erlenstar.demon.co.uk</span>) helped toexplain the<br>closing sequence in the following usenet posting:
assume that a connection is in established state, and the clientis<br>about to do an orderly release. the client's sequence no. is sc,and<br>the server's is ss. client server<br>====== ======<br>established established<br>(client closes)<br>established established<br>------->><br>fin_wait_1<br><<--------<br>fin_wait_2 close_wait<br><<-------- (server closes)<br>last_ack<br>, ------->><br>time_wait closed<br>(2*msl elapses...)<br>closed
note: the +1 on the sequence numbers is because the fin countsas one<br>byte of data. (the above diagram is equivalent to fig. 13 fromrfc<br>793).
now consider what happens if the last of those packets isdropped in<br>the network. the client has done with the connection; it has nomore<br>data or control info to send, and never will have. but the serverdoes<br>not know whether the client received all the data correctly;that's<br>what the last ack segment is for. now the server may or may notcare<br>whether the client got the data, but that is not an issue for tcp;tcp<br>is a reliable rotocol, and must distinguish between anorderly<br>connection close where all data is transferred, and a connectionabort<br>where data may or may not have been lost.
so, if that last packet is dropped, the server will retransmitit (it<br>is, after all, an unacknowledged segment) and will expect to seea<br>suitable ack segment in reply. if the client went straight toclosed,<br>the only possible response to that retransmit would be a rst,which<br>would indicate to the server that data had been lost, when in factit<br>had not been.
(bear in mind that the server's fin segment may, additionally,contain<br>data.)
disclaimer: this is my interpretation of the rfcs (i have readall the<br>tcp-related ones i could find), but i have not attempted toexamine<br>implementation source code or trace actual connections in orderto<br>verify it. i am satisfied that the logic is correct, though.
more commentarty from vic:
the second issue was addressed by richard stevens (<span style="color: #336699;">rstevens@noao.edu</span>,<br>author of "unix network programming", see ``1.5 where can i getsource<br>code for the book [book title]?''). i have put together quotesfrom<br>some of his postings and email which explain this. i havebrought<br>together paragraphs from different postings, and have made asfew<br>changes as possible.
from richard stevens (<span style="color: #336699;">rstevens@noao.edu</span>):
if the duration of the time_wait state were just to handle tcp'sfull-<br>duplex close, then the time would be much smaller, and it wouldbe<br>some function of the current rto (retransmission timeout), not themsl<br>(the packet lifetime).
a couple of points about the time_wait state.
o the end that sends the first fin goes into the time_waitstate,<br>because that is the end that sends the final ack. if theother<br>end's fin is lost, or if the final ack is lost, having the endthat<br>sends the first fin maintain state about the connectionguarantees<br>that it has enough information to retransmit the final ack.
o realize that tcp sequence numbers wrap around after 2**32bytes<br>have been transferred. assume a connection between a.1500 (hosta,<br>port 1500) and b.2000. during the connection one segment islost<br>and retransmitted. but the segment is not really lost, it isheld<br>by some intermediate router and then re-injected into thenetwork.<br>(this is called a "wandering duplicate".) but in the timebetween<br>the packet being lost & retransmitted, and thenreappearing, the<br>connection is closed (without any problems) and then another<br>connection is established between the same host, same port(that<br>is, a.1500 and b.2000; this is called another "incarnation" ofthe<br>connection). but the sequence numbers chosen for the new<br>incarnation just happen to overlap with the sequence number ofthe<br>wandering duplicate that is about to reappear. (this isindeed<br>possible, given the way sequence numbers are chosen for tcp<br>connections.) bingo, you are about to deliver the data fromthe<br>wandering duplicate (the previous incarnation of the connection)to<br>the new incarnation of the connection. to avoid this, you donot<br>allow the same incarnation of the connection to bereestablished<br>until the time_wait state terminates.
even the time_wait state doesn't complete solve the secondproblem,<br>given what is called time_wait assassination. rfc 1337 hasmore<br>details.
o the reason that the duration of the time_wait state is 2*mslis<br>that the maximum amount of time a packet can wander around a<br>network is assumed to be msl seconds. the factor of 2 is forthe<br>round-trip. the recommended value for msl is 120 seconds, but<br>berkeley-derived implementations normally use 30 secondsinstead.<br>this means a time_wait delay between 1 and 4 minutes. solaris2.x<br>does indeed use the recommended msl of 120 seconds.
a wandering duplicate is a packet that appeared to be lost andwas<br>retransmitted. but it wasn't really lost ... some router had<br>problems, held on to the packet for a while (order of seconds,could<br>be a minute if the ttl is large enough) and then re-injects thepacket<br>back into the network. but by the time it reappears, theapplication<br>that sent it originally has already retransmitted the datacontained<br>in that packet.
because of these potential problems with time_waitassassinations, one<br>should not avoid the time_wait state by setting the so_lingeroption<br>to send an rst instead of the normal tcp connectiontermination<br>(fin/ack/fin/ack). the time_wait state is there for a reason;it's<br>your friend and it's there to help you :-)
i have a long discussion of just this topic in myjust-released<br>"tcp/ip illustrated, volume 3". the time_wait state is indeed, oneof<br>the most misunderstood features of tcp.
i'm currently rewriting "unix network programming" (see ``1.5where<br>can i get source code for the book [book title]?''). and willinclude<br>lots more on this topic, as it is often confusing andmisunderstood.
an additional note from andrew:
closing a socket: if so_linger has not been called on a socket,then<br>close() is not supposed to discard data. this is true on svr4.2(and,<br>apparently, on all non-svr4 systems) but apparently not on svr4;the<br>use of either shutdown() or so_linger seems to be required to<br>guarantee delivery of all data.
原文连接:<span style="color: #336699;">http://hi.baidu.com/w_ge/blog/item/105877c6a361df1b9c163d21.html</span>
************************************************************************
文章三<br> <br>当您尝试从 tcp 端口大于 5000 连接收到错误 ' wsaenobufs (10055) '<br>症状<br>如果您尝试建立 tcp 连接从端口是大于 5000, 本地计算机响应并以下 wsaenobufs (10055)错误信息:<br>因为系统缺乏足够缓冲区空间或者因为队列已满无法执行套接字上操作。<br>解决方案<br>要点 此部分, 方法或任务包含步骤告诉您如何修改注册表。 但是, 如果修改注册表错误可能发生严重问题。 因此, 确保仔细执行这些步骤。用于添加保护之前, 修改备份注册表。 然后, 在发生问题时还原注册表。 有关如何备份和还原注册表, 请单击下列文章编号以查看microsoft 知识库中相应:<br>默认最大数量的短暂 tcp 端口为 5000 ' 适用于 ' 部分中包含产品中。 这些产品中已添加新参数。 要增加最大值是短暂端口,请按照下列步骤操作:<br>1. 启动注册表编辑器。 <br>2. 注册表, 中找到以下子项, 然后单击 参数 :<br>hkey _ local _machine\system\currentcontrolset\services\tcpip\parameters<br>3. 在 编辑 菜单, 单击 新建 , 然后添加以下注册表项:<br>maxuserport 值名称:<br>值类型: dword<br>值数据: 65534<br>有效范围: 5000 - 65534 (十进制)<br>默认: 0x1388 5000 (十进制)<br>说明: 此参数控制程序从系统请求任何可用用户端口时所用最大端口数。 通常, 1024 的值和含 5000 之间分配临时 (短期)端口。 <br>4. 退出注册表编辑器, 并重新启动计算机。
注意 一个附加 tcptimedwaitdelay 注册表参数决定多久关闭端口等待可以重用关闭端口。<br> <br>对应英文原文为:<br> <br>symptoms<br>if you try to set up tcp connections from ports that are greaterthan 5000, the local computer responds with the followingwsaenobufs (10055) error message:<br>an operation on a socket could not be performed because the systemlacked sufficient buffer space or because a queue was full.<br>resolution<br>important this section, method, or task contains steps that tellyou how to modify the registry. however, serious problems mightoccur if you modify the registry incorrectly. therefore, make surethat you follow these steps carefully. for added protection, backup the registry before you modify it. then, you can restore theregistry if a problem occurs. for more information about how toback up and restore the registry, click the following articlenumber to view the article in the microsoft knowledge base:<br>322756 (<span style="color: #336699;">http://support.microsoft.com/kb/322756/</span>) howto back up and restore the registry in windows
<br>the default maximum number of ephemeral tcp ports is 5000 in theproducts that are included in the 'applies to' section. a newparameter has been added in these products. to increase the maximumnumber of ephemeral ports, follow these steps:<br>1. start registry editor. <br>2. locate the following subkey in the registry, and then clickparameters:<br>hkey_local_machine\system\currentcontrolset\services\tcpip\parameters<br>3. on the edit menu, click new, and then add the following registryentry:<br>value name: maxuserport<br>value type: dword<br>value data: 65534<br>valid range: 5000-65534 (decimal)<br>default: 0x1388 (5000 decimal)<br>description: this parameter controls the maximum port number thatis used when a program requests any available user port from thesystem. typically , ephemeral (short-lived) ports are allocatedbetween the values of 1024 and 5000inclusive. <br>4. exit registry editor, and then restart thecomputer.
note an additional tcptimedwaitdelay registry parameterdetermines how long a closed port waits until the closed port canbe reused.<br> <br>原文连接:<span style="color: #336699;">http://support.microsoft.com/kb/q196271/</span>
andrew gierth (<span style="color: #336699;">andrew@erlenstar.demon.co.uk</span>) helped toexplain the<br>closing sequence in the following usenet posting:
assume that a connection is in established state, and the clientis<br>about to do an orderly release. the client's sequence no. is sc,and<br>the server's is ss. client server<br>====== ======<br>established established<br>(client closes)<br>established established<br> <br>resolution<br>warning serious problems might occur if you modify the registryincorrectly by using registry editor or by using another method.these problems might require that you reinstall your operatingsystem. microsoft cannot guarantee that these problems can besolved. modify the registry at your own risk.<br>the default maximum number of ephemeral tcp ports is 5000 in theproducts that are included in the 'applies to' section. a newparameter has been added in these products. to increase the maximumnumber of ephemeral ports, follow these steps: 1. start registryeditor.<br>2. locate the following subkey in the registry, and then clickparameters:<br>hkey_local_machine\system\currentcontrolset\services\tcpip\parameters<br>3. on the edit menu, click new, and then add the following registryentry:<br>value name: maxuserport<br>value type: dword<br>value data: 65534<br>valid range: 5000-65534 (decimal)<br>default: 0x1388 (5000 decimal)<br>description: this parameter controls the maximum port number thatis used when a program requests any available user port from thesystem. typically , ephemeral (short-lived) ports are allocatedbetween the values of 1024 and 5000 inclusive.<br>4. quit registry editor.
note an additional tcptimedwaitdelay registry parameterdetermines how long a closed port waits until the closed port canbe reused.
原文连接:<span style="color: #336699;">http://blog.chinaunix.net/u/29553/showart_450701.html</span>
**********************************************************************************<br>文章二
java.net.bindexception: address already in use: connect的问题<br>大概原因是短时间内newsocket操作很多,而socket.close()操作并不能立即释放绑定的端口,而是把端口设置为time_wait状态,过段时间(默认240s)才释放,(用netstat-na可以看到),最后系统资源耗尽(windows上是耗尽了pool of ephemeral ports,这段区间在1024-5000之间; )
避免出现这一问题的方法有两个,一个是调高你的web服务器的最大连接线程数,调到1024,2048都还凑合,以resin为例,修改resin.conf中的thread-pool.thread_max,如果你采用apache连resin的架构,别忘了再调整apache;
另一个是修改运行web服务器的机器的操作系统网络配置,把time wait的时间调低一些,比如30s。<br>在red hat上,查看有关的选项,<br>[xxx@xxx~]$ /sbin/sysctl -a|grep net.ipv4.tcp_tw<br>net.ipv4.tcp_tw_reuse = 0<br>net.ipv4.tcp_tw_recycle = 0<br>[xxx@xxx~]$vi /etc/sysctl,修改<br>net.ipv4.tcp_tw_reuse = 1<br>net.ipv4.tcp_tw_recycle = 1<br>[xxx@xxx~]$sysctl -p,使内核参数生效
<br>socket-faq中的这一段讲time_wait的,摘录如下:<br>2.7. please explain the time_wait state.
remember that tcp guarantees all data transmitted will bedelivered,<br>if at all possible. when you close a socket, the server goes intoa<br>time_wait state, just to be really really sure that all the datahas<br>gone through. when a socket is closed, both sides agree bysending<br>messages to each other that they will send no more data. this,it<br>seemed to me was good enough, and after the handshaking is done,the<br>socket should be closed. the problem is two-fold. first, there isno<br>way to be sure that the last ack was communicatedsuccessfully.<br>second, there may be "wandering duplicates" left on the net thatmust<br>be dealt with if they are delivered.
andrew gierth (<span style="color: #336699;">andrew@erlenstar.demon.co.uk</span>) helped toexplain the<br>closing sequence in the following usenet posting:
assume that a connection is in established state, and the clientis<br>about to do an orderly release. the client's sequence no. is sc,and<br>the server's is ss. client server<br>====== ======<br>established established<br>(client closes)<br>established established<br>------->><br>fin_wait_1<br><<--------<br>fin_wait_2 close_wait<br><<-------- (server closes)<br>last_ack<br>, ------->><br>time_wait closed<br>(2*msl elapses...)<br>closed
note: the +1 on the sequence numbers is because the fin countsas one<br>byte of data. (the above diagram is equivalent to fig. 13 fromrfc<br>793).
now consider what happens if the last of those packets isdropped in<br>the network. the client has done with the connection; it has nomore<br>data or control info to send, and never will have. but the serverdoes<br>not know whether the client received all the data correctly;that's<br>what the last ack segment is for. now the server may or may notcare<br>whether the client got the data, but that is not an issue for tcp;tcp<br>is a reliable rotocol, and must distinguish between anorderly<br>connection close where all data is transferred, and a connectionabort<br>where data may or may not have been lost.
so, if that last packet is dropped, the server will retransmitit (it<br>is, after all, an unacknowledged segment) and will expect to seea<br>suitable ack segment in reply. if the client went straight toclosed,<br>the only possible response to that retransmit would be a rst,which<br>would indicate to the server that data had been lost, when in factit<br>had not been.
(bear in mind that the server's fin segment may, additionally,contain<br>data.)
disclaimer: this is my interpretation of the rfcs (i have readall the<br>tcp-related ones i could find), but i have not attempted toexamine<br>implementation source code or trace actual connections in orderto<br>verify it. i am satisfied that the logic is correct, though.
more commentarty from vic:
the second issue was addressed by richard stevens (<span style="color: #336699;">rstevens@noao.edu</span>,<br>author of "unix network programming", see ``1.5 where can i getsource<br>code for the book [book title]?''). i have put together quotesfrom<br>some of his postings and email which explain this. i havebrought<br>together paragraphs from different postings, and have made asfew<br>changes as possible.
from richard stevens (<span style="color: #336699;">rstevens@noao.edu</span>):
if the duration of the time_wait state were just to handle tcp'sfull-<br>duplex close, then the time would be much smaller, and it wouldbe<br>some function of the current rto (retransmission timeout), not themsl<br>(the packet lifetime).
a couple of points about the time_wait state.
o the end that sends the first fin goes into the time_waitstate,<br>because that is the end that sends the final ack. if theother<br>end's fin is lost, or if the final ack is lost, having the endthat<br>sends the first fin maintain state about the connectionguarantees<br>that it has enough information to retransmit the final ack.
o realize that tcp sequence numbers wrap around after 2**32bytes<br>have been transferred. assume a connection between a.1500 (hosta,<br>port 1500) and b.2000. during the connection one segment islost<br>and retransmitted. but the segment is not really lost, it isheld<br>by some intermediate router and then re-injected into thenetwork.<br>(this is called a "wandering duplicate".) but in the timebetween<br>the packet being lost & retransmitted, and thenreappearing, the<br>connection is closed (without any problems) and then another<br>connection is established between the same host, same port(that<br>is, a.1500 and b.2000; this is called another "incarnation" ofthe<br>connection). but the sequence numbers chosen for the new<br>incarnation just happen to overlap with the sequence number ofthe<br>wandering duplicate that is about to reappear. (this isindeed<br>possible, given the way sequence numbers are chosen for tcp<br>connections.) bingo, you are about to deliver the data fromthe<br>wandering duplicate (the previous incarnation of the connection)to<br>the new incarnation of the connection. to avoid this, you donot<br>allow the same incarnation of the connection to bereestablished<br>until the time_wait state terminates.
even the time_wait state doesn't complete solve the secondproblem,<br>given what is called time_wait assassination. rfc 1337 hasmore<br>details.
o the reason that the duration of the time_wait state is 2*mslis<br>that the maximum amount of time a packet can wander around a<br>network is assumed to be msl seconds. the factor of 2 is forthe<br>round-trip. the recommended value for msl is 120 seconds, but<br>berkeley-derived implementations normally use 30 secondsinstead.<br>this means a time_wait delay between 1 and 4 minutes. solaris2.x<br>does indeed use the recommended msl of 120 seconds.
a wandering duplicate is a packet that appeared to be lost andwas<br>retransmitted. but it wasn't really lost ... some router had<br>problems, held on to the packet for a while (order of seconds,could<br>be a minute if the ttl is large enough) and then re-injects thepacket<br>back into the network. but by the time it reappears, theapplication<br>that sent it originally has already retransmitted the datacontained<br>in that packet.
because of these potential problems with time_waitassassinations, one<br>should not avoid the time_wait state by setting the so_lingeroption<br>to send an rst instead of the normal tcp connectiontermination<br>(fin/ack/fin/ack). the time_wait state is there for a reason;it's<br>your friend and it's there to help you :-)
i have a long discussion of just this topic in myjust-released<br>"tcp/ip illustrated, volume 3". the time_wait state is indeed, oneof<br>the most misunderstood features of tcp.
i'm currently rewriting "unix network programming" (see ``1.5where<br>can i get source code for the book [book title]?''). and willinclude<br>lots more on this topic, as it is often confusing andmisunderstood.
an additional note from andrew:
closing a socket: if so_linger has not been called on a socket,then<br>close() is not supposed to discard data. this is true on svr4.2(and,<br>apparently, on all non-svr4 systems) but apparently not on svr4;the<br>use of either shutdown() or so_linger seems to be required to<br>guarantee delivery of all data.
原文连接:<span style="color: #336699;">http://hi.baidu.com/w_ge/blog/item/105877c6a361df1b9c163d21.html</span>
************************************************************************
文章三<br> <br>当您尝试从 tcp 端口大于 5000 连接收到错误 ' wsaenobufs (10055) '<br>症状<br>如果您尝试建立 tcp 连接从端口是大于 5000, 本地计算机响应并以下 wsaenobufs (10055)错误信息:<br>因为系统缺乏足够缓冲区空间或者因为队列已满无法执行套接字上操作。<br>解决方案<br>要点 此部分, 方法或任务包含步骤告诉您如何修改注册表。 但是, 如果修改注册表错误可能发生严重问题。 因此, 确保仔细执行这些步骤。用于添加保护之前, 修改备份注册表。 然后, 在发生问题时还原注册表。 有关如何备份和还原注册表, 请单击下列文章编号以查看microsoft 知识库中相应:<br>默认最大数量的短暂 tcp 端口为 5000 ' 适用于 ' 部分中包含产品中。 这些产品中已添加新参数。 要增加最大值是短暂端口,请按照下列步骤操作:<br>1. 启动注册表编辑器。 <br>2. 注册表, 中找到以下子项, 然后单击 参数 :<br>hkey _ local _machine\system\currentcontrolset\services\tcpip\parameters<br>3. 在 编辑 菜单, 单击 新建 , 然后添加以下注册表项:<br>maxuserport 值名称:<br>值类型: dword<br>值数据: 65534<br>有效范围: 5000 - 65534 (十进制)<br>默认: 0x1388 5000 (十进制)<br>说明: 此参数控制程序从系统请求任何可用用户端口时所用最大端口数。 通常, 1024 的值和含 5000 之间分配临时 (短期)端口。 <br>4. 退出注册表编辑器, 并重新启动计算机。
注意 一个附加 tcptimedwaitdelay 注册表参数决定多久关闭端口等待可以重用关闭端口。<br> <br>对应英文原文为:<br> <br>symptoms<br>if you try to set up tcp connections from ports that are greaterthan 5000, the local computer responds with the followingwsaenobufs (10055) error message:<br>an operation on a socket could not be performed because the systemlacked sufficient buffer space or because a queue was full.<br>resolution<br>important this section, method, or task contains steps that tellyou how to modify the registry. however, serious problems mightoccur if you modify the registry incorrectly. therefore, make surethat you follow these steps carefully. for added protection, backup the registry before you modify it. then, you can restore theregistry if a problem occurs. for more information about how toback up and restore the registry, click the following articlenumber to view the article in the microsoft knowledge base:<br>322756 (<span style="color: #336699;">http://support.microsoft.com/kb/322756/</span>) howto back up and restore the registry in windows
<br>the default maximum number of ephemeral tcp ports is 5000 in theproducts that are included in the 'applies to' section. a newparameter has been added in these products. to increase the maximumnumber of ephemeral ports, follow these steps:<br>1. start registry editor. <br>2. locate the following subkey in the registry, and then clickparameters:<br>hkey_local_machine\system\currentcontrolset\services\tcpip\parameters<br>3. on the edit menu, click new, and then add the following registryentry:<br>value name: maxuserport<br>value type: dword<br>value data: 65534<br>valid range: 5000-65534 (decimal)<br>default: 0x1388 (5000 decimal)<br>description: this parameter controls the maximum port number thatis used when a program requests any available user port from thesystem. typically , ephemeral (short-lived) ports are allocatedbetween the values of 1024 and 5000inclusive. <br>4. exit registry editor, and then restart thecomputer.
note an additional tcptimedwaitdelay registry parameterdetermines how long a closed port waits until the closed port canbe reused.<br> <br>原文连接:<span style="color: #336699;">http://support.microsoft.com/kb/q196271/</span>
发表评论
-
qtdemo浅析
2012-02-07 16:14 1585[size=x-small;]? ? <span ... -
jquery跨域调用json数据
2012-02-03 11:39 1435? <script type="te ... -
js 数组操作代码集锦
2012-02-03 10:59 1144[size=small;]这段时间做的一个项目,用到数 ... -
json学习之三:JSONArray的应用
2012-02-02 15:29 71524从json数组中得到 ... -
Android开发之Linkify
2012-01-31 13:33 2211<h1>Android开发之Linkify ... -
Android开发之fedora13下编译Android源码
2012-01-11 16:04 1153<h1>Android开发之fedora1 ... -
SP2-0734: 未知的命令开头 "exp test/t..." - 忽略了剩余的行 解决办法
2011-12-28 14:13 3870<span style="font-f ... -
JS跨域
2011-12-21 16:43 2638原帖地址:http://itgeeker.com/ma ... -
数据结构之kmp模式匹配
2011-12-21 10:04 1185KMP字符串模式匹配详解 KMP字符串模式匹配通俗点说 ... -
去掉C/C++程序代码中的注释
2011-12-20 16:49 3060程序员面试宝典上面的题目有很多是很经典的问题,可供我 ... -
安装Microsoft .NET Framework SDK 快速入门、教程和示例
2011-12-19 10:09 2054Microsoft .NET Framework SD ... -
推荐两个关于DB2认证的站点
2011-12-19 09:59 848关于DB2认证的在线中文教程<br>htt ... -
突然想起了红色联盟 就去看了看
2011-12-17 10:54 1181突然想起了红色联盟,于是就偷偷的爬上红盟站点,看了看红 ... -
如何二次压缩RM和RMVB格式文件
2011-12-16 17:12 1121对RM/RMVB格式文件进行二次压缩,可以用一个软件E ... -
在线共享音乐吧(Online Share Music Bar)解决方案
2011-12-14 19:54 998</span></font>& ... -
使用Microsoft Web Application Stress进行压力测试
2011-12-14 18:33 879<font size="2" ... -
做了几天的调研工作
2011-12-14 17:29 1017</span></span> ... -
JNI程序如何检测C代码的内存泄漏
2011-12-13 14:59 1449Java调用C的JNI程序很容易出现内存泄漏问题,因为 ... -
《你能行:微软精英的职场心里话》
2011-12-12 14:39 961<p class="MsoNorm ... -
JSF入门十(自定义转换器)
2011-12-09 11:00 975本文参考 http://www.javaworld.c ...
相关推荐
【Java中的`java.net.BindException: Address already in use: JVM_Bind`异常】 在Java编程中,当你尝试启动一个服务器端应用,如Tomcat,或者任何需要监听特定端口的服务时,可能会遇到`java.net.BindException: ...
在myeclipse中将html文件改成jsp文件时myeclipse卡住;将之前的任务关掉;再打开时多次部署项目的时候报错
用于解决Jmeter java.net.BindException: Address already in use: connect报错的DWORD注册表文件
在Android开发过程中,网络通信是应用的重要组成部分,而使用UDP(User Datagram Protocol)进行数据传输时,可能会遇到`java.net.BindException: bind failed: EADDRINUSE`的问题。这个异常通常意味着应用程序尝试...
nested exception is: java.net.BindException: Address already in use: JVM_Bind 这里说的是1099端口被其它进程占用了. 二.解决办法 找出占用1099端口的进程,进入windows命令,查看什么进程占用了1099端口...
使用JMeter压测时,报java.net.bindexception:address already is use:connect异常,可执行本资源的.bat文件,修改系统注册表。
1. **java.net.BindException: Address already in use: JVM_Bind** 这个异常表明尝试绑定的端口已被其他服务占用。解决方法是检查并更改端口号,选择一个未被使用的端口。使用`netstat -an`命令可以帮助识别哪些...
在开发基于Java Netty的应用程序时,可能会遇到`java.net.BindException: Address already in use: no further information`这类错误。本篇文章将详细解析这一异常的原因、可能的影响以及如何有效地解决该问题。 ##...
jemeter 最初被设计用于 Web 应用测试,但后来扩展到了其他测试领域,可用于测试静态和动态资源,如静态文件、Java 小服务程序、CGI 脚本、Java 对象、数据库和 FTP 服务器等等。 jemeter 可对服务器、网络或对象...
java.net.BindException: Address already in use 该异常发生在服务器端进行 new ServerSocket(port) 操作时,原因是因为与 port 相同的端口已经被占用,解决方法是找到一个空闲的端口。 java.net....
在Java中,当我们使用`ServerSocket`类创建服务器并指定一个端口时,如果该端口已经被另一个进程占用,`bind()`方法会抛出`BindException`,具体表现为"Address already in use"。在`java.net.ServerSocket`类的源码...
nested exception is: java.net.BindException: Address already in use: JVM_Bind 这提示是 1099 端口被占用了。这是因为 Tomcat 服务器需要使用 1099 端口来启动,但是这个端口已经被其他应用程序占用了。 解决...
vhost WARN 200 - _defaultVHost_Bind failed, try again ([any]:1935): java.net.BindException: Address already in use ``` **原因分析:** 该错误通常发生在同一台服务器上有多个WowzaMediaServer实例同时运行...
java.net.BindException: Address already in use: JVM_Bind 当尝试通过`new ServerSocket(port)`创建一个服务器套接字,并指定端口号`port`(该值应在0到65536之间)时,如果出现此异常,表明所指定的端口已被...
Reason: java.io.IOException: Transport Connector could not be registered in JMX: Failed to bind to server socket: tcp://0.0.0.0:61616 due to java.net.BindException: Address already in use: JVM_Bind”...
4. **java.net.BindException: Address already in use: JVM_Bind**:这意味着8080端口已被其他服务占用。你可以通过修改Tomcat配置文件`server.xml`来改变Tomcat的默认端口,如示例所示,将端口改为80或其他未使用...
端口冲突java.net.BindException: Address already in use: JVM_Bind java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory deploy(部署)项目。点击 deploy 按钮,在弹出的Project Deployments...
2,localhost: java.net.BindException: Address already in use 3,ERROR: org.apache.hadoop.hbase.MasterNotRunningException: Retried 7 times 4,ERROR: org.apache.hadoop.hbase.MasterNotRunningException: ...
nested exception is: java.net.BindException: Address already in use: JVM_Bind 这种错误通常是由于端口号冲突或被占用导致的。 结论 Idea启动项目报端口号冲突或被占用的解决方法可以帮助开发人员快速解决...