change socket creation function to non-static for inheritance