add Close() method to TCPServer
use a channel instead of time.Sleep()