signaling

package
v0.0.0-...-b172891 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(h SessionHandler)

Listen invokes all registered listeners, passing each new Session to the provided handler. Blocks until all listeners have returned.

func RegisterListener

func RegisterListener(lf ListenFunc)

Types

type ListenFunc

type ListenFunc func(handler SessionHandler) error

A ListenFunc connects to a signaling server and listens for incoming calls. For each call it creates a Session object and invokes the provided handler.

type Session

type Session struct {
	// Context used to indicate the end of the session.
	context.Context

	// Channel for receiving SDP offer from remote peer.
	Offer <-chan string

	// Channel for receiving remote ICE candidates.
	RemoteCandidates <-chan ice.Candidate

	// Client-specific function for sending SDP answer to remote peer.
	SendAnswer func(sdpAnswer string) error

	// Client-specific function for sending local ICE candidates to remote peer.
	SendLocalCandidate func(c *ice.Candidate) error
}

A Session represents a sequence of interactions with the signaling server, wherein two peers attempt to establish a direct connection. It includes the SDP offer/answer and ICE candidate exchange.

type SessionHandler

type SessionHandler func(s *Session)

A SessionHandler responds to incoming calls.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL