MCPcopy Create free account
hub / github.com/Invisv-Privacy/masque / startReceiveLoop

Method startReceiveLoop

http3/client.go:289–305  ·  view source on GitHub ↗

startReceiveLoop starts datagramReceiveLoop with a given quic.Connection, first checking if it already has been started.

(conn quic.Connection)

Source from the content-addressed store, hash-verified

287// startReceiveLoop starts datagramReceiveLoop with a given quic.Connection, first checking
288// if it already has been started.
289func (c *Client) startReceiveLoop(conn quic.Connection) error {
290 c.logger.Info("startReceiveLoop", "conn", conn)
291 c.mutex.Lock()
292 defer c.mutex.Unlock()
293 if c.receiveLoopStarted {
294 return nil
295 }
296
297 ctx, cancel := context.WithCancel(context.Background())
298 c.datagramCtx = ctx
299 c.datagramCancel = cancel
300
301 go c.datagramReceiveLoop(conn)
302
303 c.receiveLoopStarted = true
304 return nil
305}
306
307func (c *Client) cancelAllUDPStreams() error {
308 streamList := []*DatagramStream{}

Callers 1

CreateUDPStreamMethod · 0.95

Calls 1

datagramReceiveLoopMethod · 0.95

Tested by

no test coverage detected