To close the server after you click the start server button, either use a client to connect and disconnect and then close, or just use task manager to close it. Please enter a port number and click start server. Then the server appears hang as all socket calls in this sample are blocking. Once a client connects and disconnects, the start server button is reenabled and you need to click it to be ready to take a new connection.