Added basic server-side socket handling