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.
Click to show internal directories.
Click to hide internal directories.