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)
| 54 | // |
| 55 | // Corresponding dialer is naconn.Dial/naconn.DialEx. |
| 56 | func 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 | } |
nothing calls this directly
no test coverage detected