Skip to content

Commit

Permalink
chore: increase the code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Feb 25, 2022
1 parent 1813239 commit a74f506
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions gnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,14 @@ func (t *testWakeConnServer) OnTick() (delay time.Duration, action Action) {
func testWakeConn(t *testing.T, network, addr string) {
svr := &testWakeConnServer{tester: t, network: network, addr: addr, conn: make(chan Conn, 1)}
logger := zap.NewExample()
err := Run(svr, network+"://"+addr, WithTicker(true), WithNumEventLoop(2*runtime.NumCPU()),
WithLogger(logger.Sugar()), WithReadBufferCap(2000), WithWriteBufferCap(2000))
err := Run(svr, network+"://"+addr,
WithTicker(true),
WithNumEventLoop(2*runtime.NumCPU()),
WithLogger(logger.Sugar()),
WithSocketRecvBuffer(4*1024),
WithSocketSendBuffer(4*1024),
WithReadBufferCap(2000),
WithWriteBufferCap(2000))
assert.NoError(t, err)
_ = logger.Sync()
}
Expand Down
2 changes: 1 addition & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type Options struct {
// ============================= Options for both server-side and client-side =============================

// ReadBufferCap is the maximum number of bytes that can be read from the peer when the readable event comes.
// The default value is 64KB, it can either be reduced to avoid starving the subsequent connections or increase
// The default value is 64KB, it can either be reduced to avoid starving the subsequent connections or increased
// to read more data from a socket.
//
// Note that ReadBufferCap will always be converted to the least power of two integer value greater than
Expand Down

0 comments on commit a74f506

Please sign in to comment.