add the case of socket resource leak