Raise exception in socket