Hi guys,
I'm using SFMLs network library to send simple data packets to a single client. That part works flawlessly.
When my program starts it initializes and in the end waits for a client using TCPListener.accept() with a blocking socket. When I want to close the program (console application) via CTLR+C "something" happens (e.g. OpenCV closes the connection to the webcam etc.) but the process itself doesn't quit. I have to terminate it via task manager.
If I comment the listening part out the program stops at the end of the main function as planned, so it should be a problem with the blocking socket.
What I tried is setting the socket unblocking and polling every 50ms in a while loop using sf::sleep(). But that also prevents the process to quit completely. I'd be okay using a keypress inside the while to break the loop and let the program run to the end of main, but I don't know how, as there is no window to get any events / key presses and I didn't find a way to do non-blocking console I/O via C++.
Edit:
Additional information:
Windows 8.1
SFML 2.2
Visual Studio 2013
Other used libraries: OpenCV, ArUco (AR marker tracking)
I start the process via the windows console command window.