better doc, better socket cleanup