Socket and setup functions in net.h