socket stuff that didn't get included in the last commit