wrapper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinStreams

func JoinStreams(c1, c2 net.Conn, statsCallback func(stats int64))

JoinStreams can proxy data from stream 1 to stream 2 and vice-versa statsCallback will give the amount of data copied into the first stream

func WrapConn

func WrapConn(dc *webrtc.DataChannel, laddr, raddr net.Addr) (net.Conn, error)

WrapConn wraps the datachannel in a net.Conn

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn is used to wrap the connection in a golang net.Conn

func (*Conn) Close

func (c *Conn) Close() error

Close closes the datachannel and peerconnection

func (*Conn) LocalAddr

func (c *Conn) LocalAddr() net.Addr

LocalAddr TODO

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

Read reads data from the underlying the data channel

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

RemoteAddr TODO

func (*Conn) SetDeadline

func (c *Conn) SetDeadline(t time.Time) error

SetDeadline TODO

func (*Conn) SetReadDeadline

func (c *Conn) SetReadDeadline(t time.Time) error

SetReadDeadline TODO

func (*Conn) SetWriteDeadline

func (c *Conn) SetWriteDeadline(t time.Time) error

SetWriteDeadline TODO

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

Write writes the data to the underlying data channel

type NilAddr

type NilAddr struct {
	ID string
}

NilAddr is an empty address

func (*NilAddr) Network

func (a *NilAddr) Network() string

Network needs to be exported to be compatible with net.Addr

func (*NilAddr) String

func (a *NilAddr) String() string

Jump to

Keyboard shortcuts

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