Maybe ugly but better than nothing. Besides socket corruption is highly improbable since localhost is used and the port is dynamically assigned by Qt through the server classes (QTcpServer or QUdpServer)
The semaphore was just used as a convinient counter providing possibilities of extension to multithreaded approach...
Bookmarks