private/server: monitor incoming connection kinds

Change-Id: Ia90d4fba58d87b3d5324fbe480b57c6381b9f873
This commit is contained in:
Jeff Wendling 2022-03-15 14:23:57 -04:00 committed by JT Olio
parent 52a80b2c67
commit 1bd43c1064

View File

@ -7,6 +7,7 @@ import (
"net"
"time"
"github.com/spacemonkeygo/monkit/v3"
"github.com/zeebo/errs"
"storj.io/common/netutil"
@ -46,6 +47,7 @@ func (lis *tcpUserTimeoutListener) Accept() (net.Conn, error) {
if err != nil {
return nil, err
}
mon.Event("incoming_connection", monkit.NewSeriesTag("kind", "tcp"))
if err := netutil.SetUserTimeout(conn, defaultUserTimeout); err != nil {
return nil, errs.Combine(err, conn.Close())
@ -77,6 +79,7 @@ func (lis *quicTrackedListener) Accept() (net.Conn, error) {
if err != nil {
return nil, err
}
mon.Event("incoming_connection", monkit.NewSeriesTag("kind", "quic"))
connectorConn, ok := conn.(rpc.ConnectorConn)
if !ok {