MCPcopy Create free account
hub / github.com/coder/coder / setConn

Method setConn

vpn/tunnel.go:530–539  ·  view source on GitHub ↗

setConn sets the `conn` and returns false if there's already a connection set.

(conn Conn)

Source from the content-addressed store, hash-verified

528
529// setConn sets the `conn` and returns false if there's already a connection set.
530func (u *updater) setConn(conn Conn) bool {
531 u.mu.Lock()
532 defer u.mu.Unlock()
533
534 if u.conn != nil {
535 return false
536 }
537 u.conn = conn
538 return true
539}
540
541func (u *updater) stop() error {
542 u.mu.Lock()

Callers 1

startMethod · 0.80

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected