在win上调用Web服务apache的C# - 用完了端口 [英] C# on win calling web service apache on unix - runs out of ports

查看:105
本文介绍了在win上调用Web服务apache的C# - 用完了端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我希望有人可以遵循这一切,因为我遇到了问题,所以请放心插入正确的术语和正确的概念我错了。好的 - 这就是:



我有一个应用程序通过apache将''jobs''发送到linux机器网络服务。它很慢,所以我花了一些时间来加速它,但我现在正在关于linux机器免费端口。有< 30k端口可用,keep_alive时间为2小时。我正在寻找改变它来增加可用端口和减少keep_alive时间,但还有其他机器要求保持活动时间比我希望的更长。不到2个小时,但足够长,以后我可能会碰壁。



问题在于它的核心是''做什么我这样做是为了解决这个问题吗?'',但希望我已经用这两个问题解决了这个问题:

1:有没有办法继续为每个后续请求使用单个端口?或者......

2:当我完成它时,有没有办法告诉linux机器关闭端口?



我对linux机器的访问权限有限,并且有限的范围可以改变它的行为,但如果这是唯一的(或非常好的)解决方案,它是可行的。



我真的不知道要查找哪些搜索条件,所以我找不到在线文章的方式,所以任何帮助都会非常多赞。



谢谢

G



PS:我在这里和其他技术人员交谈,他说我应该提到web服务是在wsdl中定义的,它指定了一个端口:



Hi,

I hope someone can follow all this because I am having a problem with it all, so please feel free up insert correct terminology and correct concepts I have got wrong. Ok - here goes:

I have an application that sends ''jobs'' to a linux machine via an apache web service. It''s pretty slow so I took some time to speed it up but I''m now hitting the wall with regards to the linux machines free ports. There are <30k ports available with a keep_alive time of 2 hours. I am looking onto changing this to increase available ports and reducing the keep_alive time but there are other machines that require the keep alive time to be longer than I had hoped. not quite 2 hours but long enough that I may well hit the wall in the future.

The question at it''s core is ''What do I do to solve this?'', but hopefully I have broken that down with these two questions:
1: Is there a way keep using a single port for each subsequent request?. Or...
2: Is there a way that I can tell the linux machine to close the port when I''m done with it?

I have limited access to the linux machine and limited scope to change it''s behavour, but it is do-able if that would be the only (or very much best) solution.

I don''t really know what search terms to look for so I haven''t been able to find much in the way of online articles so any help there would be very much appreciated.

Thanks
G

PS: I spoke to another techie here and he says I should mention that the webservice is defined in a wsdl that specifies a port:

  <wsdl:binding name="JobservBinding" type="tns:JobservPort">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
    <wsdl:operation name="addxec">
<!--etc...--!>





但这再次让我感到困惑:?





PS确切错误

每个插座只能使用一次地址(协议/网络地址/端口)\\\ n通常允许使用10.< ip of ==linux =server =>:80



But this again confuses me :?


PS exact error
"Only one usage of each socket address (protocol/network address/port)\r\nis normally permitted 10.<ip of="" the="" linux="" server="">:80"

推荐答案

你似乎有一个设计缺陷。您是否有30 + K个活动连接必须保持活动状态?



如果您只是连接,发送内容并断开连接,但服务器保持套接字打开,这意味着您以错误的方式关闭客户端套接字。断开连接之前,需要正确关闭TCP套接字。如果强行关闭套接字而不将其关闭,服务器无法知道套接字是否已关闭,并保持套接字的一侧打开。
You seem to have a design flaw here. Do you have 30+K active connections that must remain active?

If you just connect, send something and disconnect, but the server keeps the socket opened, this means that you close client socket in the wrong way. You need to perform correct shutdown of the TCP socket before disconnection. If you forcefully close the socket without shutting it down, the server has no way to know that the socket was closed, and keeps his side of the socket opened.


这篇关于在win上调用Web服务apache的C# - 用完了端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆