func New(appExit chan struct{}, addr string) (closer io.Closer) {
	l, err := net.Listen("tcp", addr)
	if err != nil {
		fmt.Println("Error listening: ", err)
		os.Exit(1)
	}

	fmt.Println("Listening on ", addr)

	server := &serverImpl{
		done:    make(chan struct{}),
		l:       l,
		writeCh: make(chan []byte, 128),
	}
	go server.run()
	closer = server
	return
}
// New new a tcp server
New new a tcp server
// New new a tcp server
func New(appExit chan struct{}, addr string) (closer io.Closer) {
	l, err := net.Listen("tcp", addr)
	if err != nil {
		fmt.Println("Error listening: ", err)
		os.Exit(1)
	}
	fmt.Println("Listening on ", addr)
	server := &serverImpl{
		done:    make(chan struct{}),
		l:       l,
		writeCh: make(chan []byte, 128),
	}
	go server.run()
	closer = server
	return
}
func New ( appExit chan struct { } , addr string ) ( closer io . Closer ) { l , err := net . Listen ( " " , addr ) if err != nil { fmt . Println ( " " , err ) os . Exit ( 1 ) } fmt . Println ( " " , addr ) server := & serverImpl { done : make ( chan struct { } ) , l : l , writeCh : make ( chan [ ] byte , 128 ) , } go server . run ( ) closer = server return }
New new a tcp server
New new a tcp server