refactor: remove unused --host arg from deskflow-client

This commit is contained in:
sithlord48 2025-04-04 13:41:44 -04:00 committed by Chris Rizzitello
parent d4f916c365
commit 0a33e20723
4 changed files with 15 additions and 33 deletions

View file

@ -134,24 +134,20 @@ void Client::connect(size_t addressIndex)
auto securityLevel = m_useSecureNetwork ? SecurityLevel::PeerAuth : SecurityLevel::PlainText;
try {
if (m_args.m_hostMode) {
LOG((CLOG_NOTE "waiting for server connection on %i port", m_serverAddress.getPort()));
} else {
// resolve the server hostname. do this every time we connect
// in case we couldn't resolve the address earlier or the address
// has changed (which can happen frequently if this is a laptop
// being shuttled between various networks). patch by Brent
// Priddy.
m_resolvedAddressesCount = m_serverAddress.resolve(addressIndex);
// resolve the server hostname. do this every time we connect
// in case we couldn't resolve the address earlier or the address
// has changed (which can happen frequently if this is a laptop
// being shuttled between various networks). patch by Brent
// Priddy.
m_resolvedAddressesCount = m_serverAddress.resolve(addressIndex);
// m_serverAddress will be null if the hostname address is not reolved
if (m_serverAddress.getAddress() != nullptr) {
// to help users troubleshoot, show server host name (issue: 60)
LOG(
(CLOG_NOTE "connecting to '%s': %s:%i", m_serverAddress.getHostname().c_str(),
ARCH->addrToString(m_serverAddress.getAddress()).c_str(), m_serverAddress.getPort())
);
}
// m_serverAddress will be null if the hostname address is not reolved
if (m_serverAddress.getAddress() != nullptr) {
// to help users troubleshoot, show server host name (issue: 60)
LOG(
(CLOG_NOTE "connecting to '%s': %s:%i", m_serverAddress.getHostname().c_str(),
ARCH->addrToString(m_serverAddress.getAddress()).c_str(), m_serverAddress.getPort())
);
}
// create the socket
@ -509,11 +505,8 @@ void Client::setupScreen()
void Client::setupTimer()
{
assert(m_timer == NULL);
if (!m_args.m_hostMode) {
m_timer = m_events->newOneShotTimer(2.0, NULL);
m_events->adoptHandler(Event::kTimer, m_timer, new TMethodEventJob<Client>(this, &Client::handleConnectTimeout));
}
m_timer = m_events->newOneShotTimer(2.0, NULL);
m_events->adoptHandler(Event::kTimer, m_timer, new TMethodEventJob<Client>(this, &Client::handleConnectTimeout));
}
void Client::cleanup()

View file

@ -88,8 +88,6 @@ bool ArgParser::parseClientArgs(deskflow::ClientArgs &args, int argc, const char
args.m_enableLangSync = true;
} else if (isArg(i, argc, argv, nullptr, "--invert-scroll")) {
args.m_clientScrollDirection = deskflow::ClientScrollDirection::INVERT_SERVER;
} else if (isArg(i, argc, argv, nullptr, "--host")) {
args.m_hostMode = true;
} else if (isArg(i, argc, argv, nullptr, "client")) {
++i;
continue;

View file

@ -113,7 +113,6 @@ void ClientApp::help()
<< " [--yscroll <delta>]"
<< " [--sync-language]"
<< " [--invert-scroll]"
<< " [--host]"
#ifdef WINAPI_XWINDOWS
<< " [--display <display>]"
<< " [--no-xinitthreads]"
@ -131,8 +130,6 @@ void ClientApp::help()
<< " --sync-language enable language synchronization.\n"
<< " --invert-scroll invert scroll direction on this\n"
<< " computer.\n"
<< " --host act as a host; invert server/client mode\n"
<< " and listen instead of connecting.\n"
#if WINAPI_XWINDOWS
<< " --display <display> when in X mode, connect to the X server\n"
<< " at <display>.\n"

View file

@ -34,12 +34,6 @@ public:
*/
ClientScrollDirection m_clientScrollDirection = ClientScrollDirection::SERVER;
/**
* @brief m_hostMode - activates host mode.
* Client starts a listener and waits for a server connection.
*/
bool m_hostMode = false;
/**
* @brief m_serverAddress stores deskflow server address
*/