func (c *connection) Close() error {
	c.streamLock.Lock()
	for _, s := range c.streams {
		s.Reset()
	}
	c.streams = make([]httpstream.Stream, 0)
	c.streamLock.Unlock()
	return c.conn.Close()
}
Close first sends a reset for all of the connection's streams, and then
closes the underlying spdystream.Connection.
package spdy
import (
	"net"
	"net/http"
	"sync"
	"time"
	"github.com/docker/spdystream"
	"github.com/golang/glog"
	"k8s.io/apimachinery/pkg/util/httpstream"
)
type connection struct {
	conn             *spdystream.Connection
	streams          []httpstream.Stream
	streamLock       sync.Mutex
	newStreamHandler httpstream.NewStreamHandler
}
func NewClientConnection(conn net.Conn) (httpstream.Connection, error) {
	spdyConn, err := spdystream.NewConnection(conn, false)
	if err != nil {
		defer conn.Close()
		return nil, err
	}
	return newConnection(spdyConn, httpstream.NoOpNewStreamHandler), nil
}
func NewServerConnection(conn net.Conn, newStreamHandler httpstream.NewStreamHandler) (httpstream.Connection, error) {
	spdyConn, err := spdystream.NewConnection(conn, true)
	if err != nil {
		defer conn.Close()
		return nil, err
	}
	return newConnection(spdyConn, newStreamHandler), nil
}
func newConnection(conn *spdystream.Connection, newStreamHandler httpstream.NewStreamHandler) httpstream.Connection {
	c := &connection{conn: conn, newStreamHandler: newStreamHandler}
	go conn.Serve(c.newSpdyStream)
	return c
}
const createStreamResponseTimeout = 30 * time.Second