Sockets handle must be closed. Seems, that it sometimes makes server-side infinite-loop thread