Finished separation of socket code
c