diff options
Diffstat (limited to 'synchronizer/listener.cpp')
-rw-r--r-- | synchronizer/listener.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/synchronizer/listener.cpp b/synchronizer/listener.cpp index 36fa6ea..d9ee46d 100644 --- a/synchronizer/listener.cpp +++ b/synchronizer/listener.cpp | |||
@@ -124,6 +124,9 @@ void Listener::acceptConnection() | |||
124 | this, &Listener::clientDropped); | 124 | this, &Listener::clientDropped); |
125 | m_checkConnectionsTimer->stop(); | 125 | m_checkConnectionsTimer->stop(); |
126 | 126 | ||
127 | if (socket->bytesAvailable()) { | ||
128 | readFromSocket(socket); | ||
129 | } | ||
127 | } | 130 | } |
128 | 131 | ||
129 | void Listener::clientDropped() | 132 | void Listener::clientDropped() |
@@ -156,13 +159,17 @@ void Listener::checkConnections() | |||
156 | m_checkConnectionsTimer->start(); | 159 | m_checkConnectionsTimer->start(); |
157 | } | 160 | } |
158 | 161 | ||
159 | void Listener::readFromSocket() | 162 | void Listener::onDataAvailable() |
160 | { | 163 | { |
161 | QLocalSocket *socket = qobject_cast<QLocalSocket *>(sender()); | 164 | QLocalSocket *socket = qobject_cast<QLocalSocket *>(sender()); |
162 | if (!socket) { | 165 | if (!socket) { |
163 | return; | 166 | return; |
164 | } | 167 | } |
168 | readFromSocket(socket); | ||
169 | } | ||
165 | 170 | ||
171 | void Listener::readFromSocket(QLocalSocket *socket) | ||
172 | { | ||
166 | Trace() << "Reading from socket..."; | 173 | Trace() << "Reading from socket..."; |
167 | for (Client &client: m_connections) { | 174 | for (Client &client: m_connections) { |
168 | if (client.socket == socket) { | 175 | if (client.socket == socket) { |