mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-31 13:00:26 -04:00 
			
		
		
		
	RemoteTCPSink: Handle client disconnecting immediately.
This commit is contained in:
		
							parent
							
								
									c5efd73f6b
								
							
						
					
					
						commit
						d3584f6af2
					
				| @ -881,8 +881,8 @@ RemoteTCPProtocol::Device RemoteTCPSinkSink::getDevice() | |||||||
| 
 | 
 | ||||||
| void RemoteTCPSinkSink::acceptWebConnection() | void RemoteTCPSinkSink::acceptWebConnection() | ||||||
| { | { | ||||||
|      QMutexLocker mutexLocker(&m_mutex); |     QMutexLocker mutexLocker(&m_mutex); | ||||||
|      QWebSocket *client = m_webSocketServer->nextPendingConnection(); |     QWebSocket *client = m_webSocketServer->nextPendingConnection(); | ||||||
| 
 | 
 | ||||||
|     connect(client, &QWebSocket::binaryMessageReceived, this, &RemoteTCPSinkSink::processCommand); |     connect(client, &QWebSocket::binaryMessageReceived, this, &RemoteTCPSinkSink::processCommand); | ||||||
|     connect(client, &QWebSocket::disconnected, this, &RemoteTCPSinkSink::disconnected); |     connect(client, &QWebSocket::disconnected, this, &RemoteTCPSinkSink::disconnected); | ||||||
| @ -891,8 +891,11 @@ void RemoteTCPSinkSink::acceptWebConnection() | |||||||
|     // https://bugreports.qt.io/browse/QTBUG-125874
 |     // https://bugreports.qt.io/browse/QTBUG-125874
 | ||||||
|     QTimer::singleShot(200, this, [this, client] () { |     QTimer::singleShot(200, this, [this, client] () { | ||||||
|         QMutexLocker mutexLocker(&m_mutex); |         QMutexLocker mutexLocker(&m_mutex); | ||||||
|         m_clients.append(new WebSocket(client)); |         if (client->isValid()) | ||||||
|         acceptConnection(m_clients.last()); |         { | ||||||
|  |             m_clients.append(new WebSocket(client)); | ||||||
|  |             acceptConnection(m_clients.last()); | ||||||
|  |         } | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -912,8 +915,11 @@ void RemoteTCPSinkSink::acceptTCPConnection() | |||||||
| 
 | 
 | ||||||
|     QTimer::singleShot(200, this, [this, client] () { |     QTimer::singleShot(200, this, [this, client] () { | ||||||
|         QMutexLocker mutexLocker(&m_mutex); |         QMutexLocker mutexLocker(&m_mutex); | ||||||
|         m_clients.append(new TCPSocket(client)); |         if (client->isValid()) | ||||||
|         acceptConnection(m_clients.last()); |         { | ||||||
|  |             m_clients.append(new TCPSocket(client)); | ||||||
|  |             acceptConnection(m_clients.last()); | ||||||
|  |         } | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user