socket handling beginnings