chore: remove more code for inverse connection
related: https://github.com/deskflow/deskflow/pull/8240
This commit is contained in:
@ -669,14 +669,7 @@ ISocketFactory *ServerApp::getSocketFactory() const
|
||||
|
||||
NetworkAddress ServerApp::getAddress(const NetworkAddress &address) const
|
||||
{
|
||||
if (args().m_config->isClientMode()) {
|
||||
const auto clientAddress = args().m_config->getClientAddress();
|
||||
NetworkAddress addr(clientAddress.c_str(), kDefaultPort);
|
||||
addr.resolve();
|
||||
return addr;
|
||||
} else {
|
||||
return address;
|
||||
}
|
||||
return address;
|
||||
}
|
||||
|
||||
int ServerApp::mainLoop()
|
||||
|
||||
@ -122,14 +122,6 @@ void ClientListener::removeUnknownClient(ClientProxyUnknown *unknownClient)
|
||||
}
|
||||
}
|
||||
|
||||
void ClientListener::restart()
|
||||
{
|
||||
if (m_server && m_server->isClientMode()) {
|
||||
stop();
|
||||
start();
|
||||
}
|
||||
}
|
||||
|
||||
void ClientListener::handleClientConnecting(const Event &, void *)
|
||||
{
|
||||
// accept client connection
|
||||
@ -213,7 +205,6 @@ void ClientListener::handleUnknownClientFailure(const Event &, void *vclient)
|
||||
{
|
||||
auto unknownClient = static_cast<ClientProxyUnknown *>(vclient);
|
||||
removeUnknownClient(unknownClient);
|
||||
restart();
|
||||
}
|
||||
|
||||
void ClientListener::handleClientDisconnected(const Event &, void *vclient)
|
||||
|
||||
@ -60,10 +60,6 @@ public:
|
||||
{
|
||||
return m_server;
|
||||
}
|
||||
|
||||
//! This method restarts the listener
|
||||
void restart();
|
||||
|
||||
//@}
|
||||
|
||||
private:
|
||||
|
||||
@ -586,16 +586,6 @@ std::string Config::formatInterval(const Interval &x)
|
||||
return deskflow::string::sprintf("(%d,%d)", (int)(x.first * 100.0f + 0.5f), (int)(x.second * 100.0f + 0.5f));
|
||||
}
|
||||
|
||||
std::string Config::getClientAddress() const
|
||||
{
|
||||
return m_ClientAddress;
|
||||
}
|
||||
|
||||
bool Config::isClientMode() const
|
||||
{
|
||||
return (!m_ClientAddress.empty());
|
||||
}
|
||||
|
||||
void Config::readSection(ConfigReadContext &s)
|
||||
{
|
||||
static const char s_section[] = "section:";
|
||||
@ -696,8 +686,6 @@ void Config::readSectionOptions(ConfigReadContext &s)
|
||||
addOption("", kOptionClipboardSharing, s.parseBoolean(value));
|
||||
} else if (name == "clipboardSharingSize") {
|
||||
addOption("", kOptionClipboardSharingSize, s.parseInt(value));
|
||||
} else if (name == "clientAddress") {
|
||||
m_ClientAddress = value;
|
||||
} else {
|
||||
handled = false;
|
||||
}
|
||||
|
||||
@ -462,19 +462,6 @@ public:
|
||||
Returns an interval as a parseable string.
|
||||
*/
|
||||
static std::string formatInterval(const Interval &);
|
||||
|
||||
//! Get client address as a string
|
||||
/*!
|
||||
* Return client address a string.
|
||||
*/
|
||||
std::string getClientAddress() const;
|
||||
|
||||
//! Return true if server started in client mode
|
||||
/*!
|
||||
* In client mode the server initiates connection to client
|
||||
*/
|
||||
bool isClientMode() const;
|
||||
|
||||
//@}
|
||||
|
||||
private:
|
||||
@ -503,7 +490,6 @@ private:
|
||||
InputFilter m_inputFilter;
|
||||
bool m_hasLockToScreenAction;
|
||||
IEventQueue *m_events;
|
||||
std::string m_ClientAddress;
|
||||
};
|
||||
|
||||
//! Configuration read context
|
||||
|
||||
@ -1334,7 +1334,6 @@ void Server::handleClientDisconnected(const Event &, void *vclient)
|
||||
removeOldClient(client);
|
||||
|
||||
delete client;
|
||||
m_clientListener->restart();
|
||||
}
|
||||
|
||||
void Server::handleClientCloseTimeout(const Event &, void *vclient)
|
||||
@ -2251,11 +2250,6 @@ bool Server::isReceivedFileSizeValid()
|
||||
return m_expectedFileSize == m_receivedFileData.size();
|
||||
}
|
||||
|
||||
bool Server::isClientMode() const
|
||||
{
|
||||
return m_args.m_config->isClientMode();
|
||||
}
|
||||
|
||||
void Server::sendFileToClient(const char *filename)
|
||||
{
|
||||
if (m_sendFileThread != NULL) {
|
||||
|
||||
@ -222,9 +222,6 @@ public:
|
||||
return m_fakeDragFileList;
|
||||
}
|
||||
|
||||
//! Returns true if it's client mode and server initiates connection
|
||||
bool isClientMode() const;
|
||||
|
||||
//@}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user