NewAgentConn creates a new WorkspaceAgentConn. `conn` may be unique to the WorkspaceAgentConn, or it may be shared in the case of coderd. If the conn is shared and closing it is undesirable, you may return ErrNoClose from opts.CloseFunc. This will ensure the underlying conn is not closed.
(conn *tailnet.Conn, opts AgentConnOptions)
| 38 | // conn is shared and closing it is undesirable, you may return ErrNoClose from |
| 39 | // opts.CloseFunc. This will ensure the underlying conn is not closed. |
| 40 | func NewAgentConn(conn *tailnet.Conn, opts AgentConnOptions) AgentConn { |
| 41 | return &agentConn{ |
| 42 | Conn: conn, |
| 43 | opts: opts, |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | // WrapAgentConn returns an AgentConn that delegates every operation to conn and |
| 48 | // applies closeFunc exactly once when the logical session is closed. |
no outgoing calls