在 TcpChannel 类上使用端口号范围
是否可以在 TcpChannel 类上指定一系列端口号,而不是固定端口或随机端口号。
目前,我们对远程通道使用固定端口号,但现在由于应用程序部署在 Citrix 环境中,我们需要使用一系列端口号来适应其安全环境。使用零作为端口号分配一个随机端口,然后该端口将被防火墙阻止,因此寻找可以指定要使用的端口号范围(例如 9000 - 9500)的东西
亲切的问候
诺埃尔
Is it possible to specify a range of port numbers on the TcpChannel class rather than a fixed port or random port number.
We currently use a fixed port number for a remoting channel, but now because the application is being deployed in a citrix environment we need to use a range of port numbers to fit within their security environment. Using zero as the port number allocates a random port which will then be blocked by their firewall, so looking for something that could possible specify a range of port numeers to use (e.g. 9000 - 9500)
Kind Regards
Noel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
下面是一个 vb.net 函数,它将返回一系列端口号中的下一个可用端口,以便您可以使用下一个可用端口打开套接字或执行任何需要的操作。
我并没有试图在同一个端口号上打开多个客户端或类似的疯狂事情。我只需要找出哪些端口号可供使用,并指导客户端使用该端口号。这是在 Citrix 环境中使用的,其中多个客户端尝试从不同的用户会话打开同一端口;使用下面的代码可以让我们解决这个问题。
Below is a vb.net function which will return back the next available port from a range of port number so that you can use the next available port to open up a socket or do whatever is required.
I was not trying to open up multiple clients on the same port number or anything mad like that. I just needed to figure out which port numbers where available for use and direct the client to use that port number. This was for use in a Citrix environment where multiple clients were attempting to open the same port from different user sessions; using the code below allow us to resolve the issue.
AFAIK,您不能在配置文件中指定这一点,但它当然可以在代码中完成。
AFAIK, you can't specify this in your config file, but it could certainly be done in code.
通道(包括 TcpChannel)旨在监听单个端口。如果您想监听多个端口,则需要多个通道来支持。
A Channel (TcpChannel included) is meant to listen to a single port. If you want to listen on multiple ports, you're going to need multiple Channels to support that.