+
+void BuliScoresSrv::onNewConnection()
+{
+ QTcpSocket* sock;
+ ClientConn* conn;
+
+
+ while ((sock = m_tcpServer.nextPendingConnection()) != NULL) {
+ conn = new ClientConn(sock, this);
+
+ connect(conn, SIGNAL(disconnected()), this, SLOT(onClientDisconnected()));
+ m_Clients.append(conn);
+ qDebug() << "New Client: " << sock->peerAddress().toString()
+ << "\tNumber of clients: " << m_Clients.count();
+ }
+}
+
+void BuliScoresSrv::onClientDisconnected()
+{
+ m_Clients.removeOne((ClientConn*)QObject::sender());
+ qDebug() << "Client disconnected, number of clients: " << m_Clients.count();
+ delete QObject::sender();
+}
+