前言
测试的同事反馈接口返回异常,如下
I/O error on POST request for “接口地址”: Address already in use: connect; nested exception is java.net.BindException: Address already in use: connect
org.springframework.web.client.ResourceAccessException: I/O error on POST request for “接口地址”: Address already in use: connect; nested exception is java.net.BindException: Address already in use: connect
网上搜了一些参考资料
参考资料1
参考资料2
大致意思就是说,服务器临时端口资源耗尽 or 客户端临时端口资源耗尽
处理方法
开放客户端临时端口,我本机是window,执行以下命令后,10分钟发送20万个请求,全部成功
netsh int ipv4 set dynamicport tcp start=20000 num=90000