Skip to content

Commit 50615a5

Browse files
committed
add punctuation and default OS config to benchmark
1 parent 06962e3 commit 50615a5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

benchmark/benchmain/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ func makeClients(bf stats.Features) ([]testgrpc.BenchmarkServiceClient, func())
373373
logger.Fatalf("Failed to listen: %v", err)
374374
}
375375
opts = append(opts, grpc.WithContextDialer(func(ctx context.Context, address string) (net.Conn, error) {
376-
return nw.ContextDialer((&net.Dialer{}).DialContext)(ctx, "tcp", lis.Addr().String())
376+
return nw.ContextDialer((&net.Dialer{KeepAlive: time.Duration(-1)}).DialContext)(ctx, "tcp", lis.Addr().String())
377377
}))
378378
}
379379
lis = nw.Listener(lis)

dialoptions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ func WithTimeout(d time.Duration) DialOption {
419419
// To retain OS defaults, use a net.Dialer with the KeepAlive field set to a
420420
// negative value.
421421
//
422-
// For more information, please see [issue 23459] in the Go github repo
422+
// For more information, please see [issue 23459] in the Go github repo.
423423
//
424424
// [issue 23459]: https://github.com/golang/go/issues/23459
425425
func WithContextDialer(f func(context.Context, string) (net.Conn, error)) DialOption {

server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ func (l *listenSocket) Close() error {
819819
// To retain OS defaults, pass a net.Listener created by calling the Listen method
820820
// on a net.ListenConfig with the `KeepAlive` field set to a negative value.
821821
//
822-
// For more information, please see [issue 23459] in the Go github repo
822+
// For more information, please see [issue 23459] in the Go github repo.
823823
//
824824
// [issue 23459]: https://github.com/golang/go/issues/23459
825825
func (s *Server) Serve(lis net.Listener) error {

0 commit comments

Comments
 (0)