Fix discovery server behavior 

Fix discovery server behavior after there has been a problem with one connection (for example, premature close from client side).