Move send and recv functionality to sock class.