Make socket.[ch] independent of common.h