Files
SimpleRemoter/server/2015Remote/SettingDlg.h
T
yuanyuanxianganddeepseek-flash dfac2b5179 Feature: switch hosts to the experimental UDP and KCP transports
The switch only offered direct TCP, WS and WSS; UDP and KCP are now
experimental menu entries, and the radio item follows the real transport.

The server maps ghost/UDPOption to real listeners (a "UDP;KCP" setup
used to collapse to one UDP port). A switch sends the master address and
that transport's port, refused behind an upper-level FRP. The client
persists the override, recreates its connection object when the transport
changes, and disconnects an unacknowledged switch after 60 s so the 300 s
revert can run. TCP/WS/WSS behaviour is unchanged.

Reconnecting a KCP client reused the same object: a fresh std::thread
over the old one aborted the process and leaked the ikcp session;
ConnectServer now joins the update thread and releases the session first,
and the UDP one also clears the stale login-ack flag. KCP contexts no
longer touch the shared listener socket: CancelIO is a no-op, Disconnect
looks up by IP:port and defers deletion behind the receive thread's
reference, COMMAND_BYE leaves the socket alone, and Disconnect stays
silent like UDP's. Oversized messages are delivered in chunks.

A datagram host has no disconnect event, so a new login for the same id
was parked as standby for up to 120 s while the client gave up after
60 s; a UDP/KCP or different-transport login now replaces it immediately.

The new labels, prompts and settings hint are translated in the
en_US/de_DE/zh_TW packs; UDPOption also accepts 0/1 in port order.
Verified: Debug build; switch directions plus KCP delete/reconnect/file-transfer tested.

Co-Authored-By: deepseek-flash
2026-11-29 20:34:08 +01:00

61 lines
1.7 KiB
C++

#pragma once
#include "afxwin.h"
#include "LangManager.h"
#include "2015RemoteDlg.h"
// CSettingDlg 对话框
class CSettingDlg : public CDialogLang
{
DECLARE_DYNAMIC(CSettingDlg)
public:
CSettingDlg(CMy2015RemoteDlg* pParent); // 标准构造函数
virtual ~CSettingDlg();
CMy2015RemoteDlg* g_2015RemoteDlg = nullptr;
// 对话框数据
enum { IDD = IDD_DIALOG_SET };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CString m_nListenPort;
UINT m_nMax_Connect;
virtual BOOL OnInitDialog();
afx_msg void OnBnClickedButtonSettingapply();
afx_msg void OnEnChangeEditPort();
afx_msg void OnEnChangeEditMax();
CButton m_ApplyButton;
virtual void OnOK();
CComboBox m_ComboScreenCapture;
CString m_sScreenCapture;
CComboBox m_ComboScreenCompress;
CString m_sScreenCompress;
CEdit m_EditReportInterval;
int m_nReportInterval;
CComboBox m_ComboSoftwareDetect;
CString m_sSoftwareDetect;
CEdit m_EditPublicIP;
CString m_sPublicIP;
afx_msg void OnBnClickedRadioAllScreen();
afx_msg void OnBnClickedRadioMainScreen();
CEdit m_EditUdpOption;
CString m_sUdpOption;
CToolTipCtrl m_tip; // UDP 协议参数编辑框的悬浮提示
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnBnClickedRadioFrpOff();
afx_msg void OnBnClickedRadioFrpOn();
CEdit m_EditFrpPort;
int m_nFrpPort;
CEdit m_EditFrpToken;
CString m_sFrpToken;
CComboBox m_ComboVideoWall;
CEdit m_EditFileServerPort;
int m_nFileServerPort;
afx_msg void OnEnKillfocusEditPublicIp();
CString m_sOriginalMaster; // 缓存原始公网地址,用于检测修改
};