MCPcopy Index your code
hub / github.com/coder/coder / WebsocketNetConn

Function WebsocketNetConn

coderd/workspaceapps/proxy.go:844–851  ·  view source on GitHub ↗

WebsocketNetConn wraps websocket.NetConn and returns a context that is tied to the parent context and the lifetime of the conn. Any error during read or write will cancel the context, but not close the conn. Close should be called to release context resources.

(ctx context.Context, conn *websocket.Conn, msgType websocket.MessageType)

Source from the content-addressed store, hash-verified

842// during read or write will cancel the context, but not close the
843// conn. Close should be called to release context resources.
844func WebsocketNetConn(ctx context.Context, conn *websocket.Conn, msgType websocket.MessageType) (context.Context, net.Conn) {
845 ctx, cancel := context.WithCancel(ctx)
846 nc := websocket.NetConn(ctx, conn, msgType)
847 return ctx, &wsNetConn{
848 cancel: cancel,
849 Conn: nc,
850 }
851}

Callers 2

watchChatDesktopMethod · 0.92
workspaceAgentPTYMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected