bug fix: the problem is that stream and socket has not closed

closed the stream and socket won't use any more.