network.h is exception-safe