func acceptWebsocket(server *Server, lis *net.TCPListener) {
	var (
		conn *net.TCPConn
		err  error
		r    int
	)
	for {
		if conn, err = lis.AcceptTCP(); err != nil {
			// if listener close then return
			log.Errorf("listener.Accept(%s) error(%v)", lis.Addr().String(), err)
			return
		}
		if err = conn.SetKeepAlive(server.c.TCP.KeepAlive); err != nil {
			log.Errorf("conn.SetKeepAlive() error(%v)", err)
			return
		}
		if err = conn.SetReadBuffer(server.c.TCP.Rcvbuf); err != nil {
			log.Errorf("conn.SetReadBuffer() error(%v)", err)
			return
		}
		if err = conn.SetWriteBuffer(server.c.TCP.Sndbuf); err != nil {
			log.Errorf("conn.SetWriteBuffer() error(%v)", err)
			return
		}
		go serveWebsocket(server, conn, r)
		if r++; r == maxInt {
			r = 0
		}
	}
}
// Accept accepts connections on the listener and serves requests
// for each incoming connection.  Accept blocks; the caller typically
// invokes it in a go statement.
Accept accepts connections on the listener and serves requests
for each incoming connection.  Accept blocks; the caller typically
invokes it in a go statement.
// Accept accepts connections on the listener and serves requests // for each incoming connection . Accept blocks ; the caller typically // invokes it in a go statement .
func acceptWebsocket(server *Server, lis *net.TCPListener) {
	var (
		conn *net.TCPConn
		err  error
		r    int
	)
	for {
		if conn, err = lis.AcceptTCP(); err != nil {
			log.Errorf("listener.Accept(%s) error(%v)", lis.Addr().String(), err)
			return
		}
		if err = conn.SetKeepAlive(server.c.TCP.KeepAlive); err != nil {
			log.Errorf("conn.SetKeepAlive() error(%v)", err)
			return
		}
		if err = conn.SetReadBuffer(server.c.TCP.Rcvbuf); err != nil {
			log.Errorf("conn.SetReadBuffer() error(%v)", err)
			return
		}
		if err = conn.SetWriteBuffer(server.c.TCP.Sndbuf); err != nil {
			log.Errorf("conn.SetWriteBuffer() error(%v)", err)
			return
		}
		go serveWebsocket(server, conn, r)
		if r++; r == maxInt {
			r = 0
		}
	}
}
func acceptWebsocket ( server * Server , lis * net . TCPListener ) { var ( conn * net . TCPConn err error r int ) for { if conn , err = lis . AcceptTCP ( ) ; err != nil { log . Errorf ( " " , lis . Addr ( ) . String ( ) , err ) return } if err = conn . SetKeepAlive ( server . c . TCP . KeepAlive ) ; err != nil { log . Errorf ( " " , err ) return } if err = conn . SetReadBuffer ( server . c . TCP . Rcvbuf ) ; err != nil { log . Errorf ( " " , err ) return } if err = conn . SetWriteBuffer ( server . c . TCP . Sndbuf ) ; err != nil { log . Errorf ( " " , err ) return } go serveWebsocket ( server , conn , r ) if r ++ ; r == maxInt { r = 0 } } }
Accept accepts connections on the listener and serves requests
for each incoming connection.
Accept accepts connections on the listener and serves requests for each incoming connection .
// if listener close then return