File tree 2 files changed +5
-0
lines changed
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -18,27 +18,31 @@ var defaultoptions = options{
18
18
wtimeout : 30 * time .Second ,
19
19
}
20
20
21
+ // WithReadBuffer set read buffer size of connection
21
22
func WithReadBuffer (sz int ) Option {
22
23
return func (opt options ) options {
23
24
opt .rbuf = sz
24
25
return opt
25
26
}
26
27
}
27
28
29
+ // WithWriteBuffer set write buffer size of connection
28
30
func WithWriteBuffer (sz int ) Option {
29
31
return func (opt options ) options {
30
32
opt .wbuf = sz
31
33
return opt
32
34
}
33
35
}
34
36
37
+ // WithReadTimeout set read timeout of Conn.Recv
35
38
func WithReadTimeout (t time.Duration ) Option {
36
39
return func (opt options ) options {
37
40
opt .rtimeout = t
38
41
return opt
39
42
}
40
43
}
41
44
45
+ // WithWriteTimeout set write timeout of Conn.Send
42
46
func WithWriteTimeout (t time.Duration ) Option {
43
47
return func (opt options ) options {
44
48
opt .wtimeout = t
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ var replyPool = sync.Pool{
35
35
},
36
36
}
37
37
38
+ // NewReply creates Reply instance from pool
38
39
func NewReply () * Reply {
39
40
return replyPool .Get ().(* Reply )
40
41
}
You can’t perform that action at this time.
0 commit comments