- reworked socket handling