Feature: TCP/UDP connection management with force-disconnect

Add a connection-management feature to YAMA: a toolbar button (after MCP)
opens a dialog listing the managed host's TCP/UDP connections, with
right-click force-disconnect for IPv4 TCP rows.

Client: a new CConnectionsManager enumerates connections via iphlpapi
(GetExtendedTcpTable/GetExtendedUdpTable, IPv4+IPv6) and answers the
refresh and kill commands over a sub-connection.

Server: a new CConnectionsDlg (DialogBase) shows the list with sortable
columns and a right-click menu; the title-bar icon reuses the toolbar's
connection icon (res/connections.ico).

Fix byte order found during review: iphlpapi returns an IPv4 address as a
network-order DWORD and the port's low 16 bits in network order, so
storing them raw made the dialog show reversed IPv4 addresses and ports.
The client now stores addresses as network-order bytes and ports as host
order (ntohs), and reverses the conversion on disconnect.

Co-Authored-By: deepseek-v4-pro
This commit is contained in:
yuanyuanxianganddeepseek-v4-pro committed 2026-10-04 18:23:06 +02:00
1 parent 8d0f419093
commit bbdb4104bf
24 files changed
+979 -2

No files matched your search

+9
View File
@@ -2067,3 +2067,12 @@ JPEG
%s · 约 %.2f MB/s=%s · about %.2f MB/s
%s · 不受限速(受网络带宽约束)=%s · Unlimited (limited by network bandwidth)
文件传输速度已保存。上传速度重启主控端后生效;下载速度下次打开文件管理或远程桌面后生效。=Transfer speed saved. Upload speed takes effect after restarting the master; download speed takes effect the next time you open File Manager or Remote Desktop.
连接管理=Connections
%s - 连接管理=%s - Connections
本地地址=Local Address
本地端口=Local Port
远端地址=Remote Address
远端端口=Remote Port
连接数:%d=Connections: %d
强制断开=Force Disconnect
+9
View File
@@ -2058,3 +2058,12 @@ JPEG
%s · 约 %.2f MB/s=%s · 約 %.2f MB/s
%s · 不受限速(受网络带宽约束)=%s · 不限速(受網路頻寬限制)
文件传输速度已保存。上传速度重启主控端后生效;下载速度下次打开文件管理或远程桌面后生效。=檔案傳輸速度已儲存。上傳速度重啟主控端後生效;下載速度下次開啟檔案管理或遠端桌面後生效。
连接管理=連線管理
%s - 连接管理=%s - 連線管理
本地地址=本機位址
本地端口=本機連接埠
远端地址=遠端位址
远端端口=遠端連接埠
连接数:%d=連線數:%d
强制断开=強制中斷