Misunderstanding of socket use