Fix discovery server behavior after there has been a problem with one connection (for example, premature close from client side).
Merge pull request #2 from atiselsts/discovery_fix

Fix discovery server behavior