more refactoring
This commit is contained in:
@ -35,7 +35,9 @@ package transport
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"golang.org/x/net/http2"
|
"golang.org/x/net/http2"
|
||||||
)
|
)
|
||||||
@ -46,16 +48,14 @@ const (
|
|||||||
// The initial window size for flow control.
|
// The initial window size for flow control.
|
||||||
initialWindowSize = defaultWindowSize // for an RPC
|
initialWindowSize = defaultWindowSize // for an RPC
|
||||||
initialConnWindowSize = defaultWindowSize * 16 // for a connection
|
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 following defines various control items which could flow through
|
||||||
// the control buffer of transport. They represent different aspects of
|
// the control buffer of transport. They represent different aspects of
|
||||||
// control tasks, e.g., flow control, settings, streaming resetting, etc.
|
// control tasks, e.g., flow control, settings, streaming resetting, etc.
|
||||||
|
|
||||||
type resetKeepaliveTimer struct{}
|
|
||||||
|
|
||||||
func (resetKeepaliveTimer) item() {}
|
|
||||||
|
|
||||||
type windowUpdate struct {
|
type windowUpdate struct {
|
||||||
streamID uint32
|
streamID uint32
|
||||||
increment uint32
|
increment uint32
|
||||||
|
@ -41,10 +41,8 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"math"
|
|
||||||
"net"
|
"net"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
|
||||||
|
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
@ -611,10 +609,3 @@ func wait(ctx context.Context, done, goAway, closing <-chan struct{}, proceed <-
|
|||||||
return i, nil
|
return i, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// keepalive related constants.
|
|
||||||
const (
|
|
||||||
infinity = time.Duration(math.MaxInt64)
|
|
||||||
defaultKeepaliveTime = infinity
|
|
||||||
defaultKeepaliveTimeout = time.Duration(20 * time.Second)
|
|
||||||
)
|
|
||||||
|
Reference in New Issue
Block a user