This commit is contained in:
iamqizhao 2015-07-24 11:26:21 -07:00
Родитель 611d960757
Коммит 23c960bc01
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -53,10 +53,10 @@ import (
// http2Client implements the ClientTransport interface with HTTP2.
type http2Client struct {
target string // server name/addr
target string // server name/addr
userAgent string
conn net.Conn // underlying communication channel
nextID uint32 // the next stream ID to be used
conn net.Conn // underlying communication channel
nextID uint32 // the next stream ID to be used
// writableChan synchronizes write access to the transport.
// A writer acquires the write lock by sending a value on writableChan
@ -165,9 +165,9 @@ func newHTTP2Client(addr string, opts *ConnectOptions) (_ ClientTransport, err e
}
var buf bytes.Buffer
t := &http2Client{
target: addr,
target: addr,
userAgent: ua,
conn: conn,
conn: conn,
// The client initiated stream id is odd starting from 1.
nextID: 1,
writableChan: make(chan int, 1),

Просмотреть файл

@ -321,13 +321,13 @@ func NewServerTransport(protocol string, conn net.Conn, maxStreams uint32) (Serv
// ConnectOptions covers all relevant options for dialing a server.
type ConnectOptions struct {
// UserAgent is the application user agent.
UserAgent string
UserAgent string
// Dialer specifies how to dial a network address.
Dialer func(string, time.Duration) (net.Conn, error)
Dialer func(string, time.Duration) (net.Conn, error)
// AuthOptions stores the credentials required to setup a client connection and issue RPCs.
AuthOptions []credentials.Credentials
// Timeout specifies the timeout for dialing a client connection.
Timeout time.Duration
Timeout time.Duration
}
// NewClientTransport establishes the transport with the required ConnectOptions