more refactoring

This commit is contained in:
Mahak Mukhi
2017-02-28 12:41:34 -08:00
parent 3ad78109b1
commit e328ededa4
2 changed files with 6 additions and 15 deletions

View File

@ -35,7 +35,9 @@ package transport
import (
"fmt"
"math"
"sync"
"time"
"golang.org/x/net/http2"
)
@ -44,18 +46,16 @@ const (
// The default value of flow control window size in HTTP2 spec.
defaultWindowSize = 65535
// The initial window size for flow control.
initialWindowSize = defaultWindowSize // for an RPC
initialConnWindowSize = defaultWindowSize * 16 // for a connection
initialWindowSize = defaultWindowSize // for an RPC
initialConnWindowSize = defaultWindowSize * 16 // for a connection
defaultKeepaliveTime = time.Duration(math.MaxInt64)
defaultKeepaliveTimeout = time.Duration(20 * time.Second)
)
// The following defines various control items which could flow through
// the control buffer of transport. They represent different aspects of
// control tasks, e.g., flow control, settings, streaming resetting, etc.
type resetKeepaliveTimer struct{}
func (resetKeepaliveTimer) item() {}
type windowUpdate struct {
streamID uint32
increment uint32

View File

@ -41,10 +41,8 @@ import (
"bytes"
"fmt"
"io"
"math"
"net"
"sync"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc/codes"
@ -611,10 +609,3 @@ func wait(ctx context.Context, done, goAway, closing <-chan struct{}, proceed <-
return i, nil
}
}
// keepalive related constants.
const (
infinity = time.Duration(math.MaxInt64)
defaultKeepaliveTime = infinity
defaultKeepaliveTimeout = time.Duration(20 * time.Second)
)