From a74f506f6e313a6a1e21ceeaadbb15b446da47fd Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Fri, 25 Feb 2022 23:07:15 +0800 Subject: [PATCH] chore: increase the code coverage --- gnet_test.go | 10 ++++++++-- options.go | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gnet_test.go b/gnet_test.go index eadaecf81..796c37b9a 100644 --- a/gnet_test.go +++ b/gnet_test.go @@ -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() } diff --git a/options.go b/options.go index 40c361c5a..931385b9f 100644 --- a/options.go +++ b/options.go @@ -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