close tcp connection after finish