Socket creation and initialisation