MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / AcceptNAConn

Function AcceptNAConn

rpc/accept.go:56–67  ·  view source on GitHub ↗

AcceptNAConn accepts connection as a naconn.NAConn. Default accept function of RPC server, and also the only accept function for the connections from a NAConnPool. Corresponding dialer is naconn.Dial/naconn.DialEx.

(ctx context.Context, conn net.Conn)

Source from the content-addressed store, hash-verified

54//
55// Corresponding dialer is naconn.Dial/naconn.DialEx.
56func AcceptNAConn(ctx context.Context, conn net.Conn) (net.Conn, error) {
57 naconn, err := Accept(conn)
58 if err != nil {
59 log.WithFields(log.Fields{
60 "local": conn.LocalAddr(),
61 "remote": conn.RemoteAddr(),
62 }).WithError(err).Error("failed to accept NAConn")
63 _ = conn.Close()
64 return nil, err
65 }
66 return naconn, nil
67}

Callers

nothing calls this directly

Calls 7

WithFieldsFunction · 0.92
AcceptFunction · 0.85
ErrorMethod · 0.80
WithErrorMethod · 0.80
LocalAddrMethod · 0.80
RemoteAddrMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected