Socket creation

merging as it is