session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletionHandler

type CompletionHandler func()

CompletionHandler to be called when transfer is done

type Session

type Session struct {
	Done         chan struct{}
	NetworkStats *stats.Stats
	// contains filtered or unexported fields
}

Session contains common elements to perform send/receive

func New

func New(sdpInput io.Reader, sdpOutput io.Writer) Session

New creates a new Session

func (*Session) CreateAnswer

func (s *Session) CreateAnswer() error

CreateAnswer set the local description and print the answer SDP

func (*Session) CreateConnection

func (s *Session) CreateConnection(onConnectionStateChange func(connectionState webrtc.ICEConnectionState)) error

CreateConnection prepares a WebRTC connection

func (*Session) CreateDataChannel

func (s *Session) CreateDataChannel(c *webrtc.DataChannelInit) (*webrtc.DataChannel, error)

CreateDataChannel that will be used to send data

func (*Session) CreateOffer

func (s *Session) CreateOffer() error

CreateOffer set the local description and print the offer SDP

func (*Session) OnCompletion

func (s *Session) OnCompletion()

OnCompletion is called when session ends

func (*Session) OnDataChannel

func (s *Session) OnDataChannel(handler func(d *webrtc.DataChannel))

OnDataChannel sets an OnDataChannel handler

func (*Session) ReadSDP

func (s *Session) ReadSDP() error

ReadSDP from the SDP input stream

func (*Session) SDPProvider

func (s *Session) SDPProvider() io.Reader

SDPProvider returns the SDP input

Jump to

Keyboard shortcuts

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