fix socket manage bug

write after close