server now handles socket closing events