This commit is contained in:
iamqizhao
2015-07-24 11:26:21 -07:00
parent 611d960757
commit 23c960bc01
2 changed files with 8 additions and 8 deletions

View File

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

View File

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