Socket handler for input and output
Merged conflicts