编程捕获iSeries的端口信息

发布于 2025-02-12 04:03:42 字数 212 浏览 1 评论 0 原文

目前,我们从客户端从端口9020接收。该客户端使用端口的末端开关,有时我们会在一个端口上使用多个“已建立”连接 - 全部带有不同的远程端口。我们可以手动结束每个已建立的连接,几秒钟后我们的工作将再次连接。我们还可以为列出的每个远程端口运行EndTCPCNN。我们正在寻找一种方法,以编程方式查看是否有多个远程端口连接到本地端口,如果是这样,则结束已建立的连接(在让侦听器运行时)。有人知道一种获取信息的方法吗?

Currently we receive on port 9020 from a client. That client uses port switching on their end and sometimes we wind up with multiple "Established" connections on the one port - all with different remote ports. We can manually end each established connection and our job will connect again after a few seconds. We can also run ENDTCPCNN for each remote port listed. We are looking for a way to programmatically see if there are multiple remote ports connected to the local port and if so end the established connections (while leaving the Listener running). Does anyone know of a way to get the information?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

度的依靠╰つ 2025-02-19 04:03:42

要回答您的问题,假设您是OS的支持版本,请看一下 QSYS2.NETSTAT_INFO SQL视图。

select local_port, remote_port, protocol, tcp_state, idle_time, network_connection_type
 from qsys2.netstat_info
where local_port = 9020;

否则,您需要使用自己。

但是您确定需要这样做吗?听起来客户正在将连接打开以进行重复使用。这是表演的好事。您的服务器代码应自动计时并关闭空闲连接。

To answer your question, assuming you are on a supported version of the OS, take a look at the QSYS2.NETSTAT_INFO SQL view.

select local_port, remote_port, protocol, tcp_state, idle_time, network_connection_type
 from qsys2.netstat_info
where local_port = 9020;

Otherwise, you'd need to use the List Network Connections and Retrieve Network Connection Data APIs yourself.

But are you sure you need to do this? Sounds like the client is leaving the connection open for re-use. That's a good thing for performance. You server code should be automatically timing out and closing idle connections.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文