MCPcopy Create free account
hub / github.com/pion/ice / pipeWithVNetUsingOptions

Function pipeWithVNetUsingOptions

connectivity_vnet_test.go:290–319  ·  view source on GitHub ↗
(t *testing.T, opts0, opts1 []AgentOption)

Source from the content-addressed store, hash-verified

288}
289
290func pipeWithVNetUsingOptions(t *testing.T, opts0, opts1 []AgentOption) (*Conn, *Conn) {
291 t.Helper()
292
293 aNotifier, aConnected := onConnected()
294 bNotifier, bConnected := onConnected()
295
296 aAgent, err := NewAgentWithOptions(opts0...)
297 require.NoError(t, err)
298 if err = aAgent.OnConnectionStateChange(aNotifier); err != nil {
299 require.NoError(t, err)
300 }
301
302 bAgent, err := NewAgentWithOptions(opts1...)
303 require.NoError(t, err)
304 if err = bAgent.OnConnectionStateChange(bNotifier); err != nil {
305 require.NoError(t, err)
306 }
307
308 t.Cleanup(func() {
309 require.NoError(t, aAgent.Close(), "failed to close agent0")
310 require.NoError(t, bAgent.Close(), "failed to close agent1")
311 })
312
313 aConn, bConn := connectWithVNet(t, aAgent, bAgent)
314
315 <-aConnected
316 <-bConnected
317
318 return aConn, bConn
319}
320
321func closePipe(t *testing.T, ca *Conn, cb *Conn) {
322 t.Helper()

Calls 5

onConnectedFunction · 0.85
NewAgentWithOptionsFunction · 0.85
connectWithVNetFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…