Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultMaxSleepTime = 1 * time.Second // accept中间最大sleep interval DefaultMAXConnNum = 50 * 1024 * 1024 // 默认最大连接数 50w DefaultHTTPRspBufferSize = 1024 PathPrefix byte = byte('/') )
View Source
const ( DefaultTCPReadBufferSize = 256 * 1024 DefaultTCPWriteBufferSize = 128 * 1024 )
View Source
const (
REQ_Q_SIZE = 1 // http1.1形式的短连接,一次也只能处理一个请求,放大size无意义
)
Variables ¶
View Source
var (
DefaultDialTimeout = time.Second * 5
)
Functions ¶
This section is empty.
Types ¶
type DialOption ¶
type DialOption func(*DialOptions)
func WithPath ¶
func WithPath(path string) DialOption
func WithTimeout ¶
func WithTimeout(d time.Duration) DialOption
Timeout used when dialling the remote side
type DialOptions ¶
type ListenOption ¶
type ListenOption func(*ListenOptions)
type ListenOptions ¶
type NewTransport ¶ added in v0.2.0
type Transport ¶
type Transport interface { Options() *Options Dial(addr string, opts ...DialOption) (Client, error) Listen(addr string, opts ...ListenOption) (Listener, error) String() string }
Transport is an interface which is used for communication between services. It uses socket send/recv semantics.
func NewHTTPTransport ¶
just leave here to compatible with v0.1
func NewTCPTransport ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.