Documentation
¶
Index ¶
- Constants
- Variables
- type AddressFamily
- type Agent
- type Attribute
- type Base
- type Candidate
- type CandidatePair
- type CandidatePairState
- type Checklist
- type DataStream
- func (s *DataStream) Close() error
- func (s *DataStream) Done() <-chan struct{}
- func (s *DataStream) Err() error
- func (s *DataStream) LocalAddr() net.Addr
- func (s *DataStream) Read(b []byte) (int, error)
- func (s *DataStream) RemoteAddr() net.Addr
- func (s *DataStream) SetDeadline(t time.Time) error
- func (s *DataStream) SetReadDeadline(t time.Time) error
- func (s *DataStream) SetWriteDeadline(t time.Time) error
- func (s *DataStream) Write(b []byte) (int, error)
- type IPAddress
- type PriorityTable
- type TransportAddress
- type TransportProtocol
Constants ¶
const ( TCP TransportProtocol = "tcp" UDP TransportProtocol = "udp" Unresolved AddressFamily = 0 IPv4 AddressFamily = 4 IPv6 AddressFamily = 6 )
Variables ¶
var ErrReadTimeout = errors.New("read timeout")
Functions ¶
This section is empty.
Types ¶
type AddressFamily ¶
type AddressFamily int
Address family is either IPv4, IPv6, or Unresolved (indicating that the stored IPAddress hasn't actually been resolved yet).
type Agent ¶
In the language of the above specification, this is a Full implementation of a Controlled ICE agent, supporting a single component of a single data stream.
func (*Agent) GetDataStream ¶
func (a *Agent) GetDataStream(ctx context.Context) (*DataStream, error)
GetDataStream waits for a connection to be established.
type Base ¶
type Base struct { net.PacketConn // contains filtered or unexported fields }
[RFC8445] defines a base to be "The transport address that an ICE agent sends from for a particular candidate." It is represented here by a UDP connection, listening on a single port.
type Candidate ¶
type Candidate struct {
// contains filtered or unexported fields
}
An ICE candidate (either local or remote). See [RFC8445 §5.3] for a definition of fields.
func ParseCandidate ¶
An ICE candidate line is a string of the form
candidate:{foundation} {component-id} {transport} {priority} {connection-address} {port} typ {cand-type} ...
See https://tools.ietf.org/html/draft-ietf-mmusic-ice-sip-sdp-24#section-4.1
type CandidatePair ¶
type CandidatePair struct {
// contains filtered or unexported fields
}
func (*CandidatePair) Priority ¶
func (p *CandidatePair) Priority() uint64
TODO: Handle case where we're the controlling agent.
func (*CandidatePair) String ¶
func (p *CandidatePair) String() string
type CandidatePairState ¶
type CandidatePairState int
Candidate pair states
const ( Frozen CandidatePairState = iota Waiting InProgress Succeeded Failed )
func (CandidatePairState) String ¶
func (state CandidatePairState) String() string
type DataStream ¶
type DataStream struct {
// contains filtered or unexported fields
}
A DataStream represents an active connection between two peers. ICE control packets are filtered out and handled by the ICE agent, so reads and writes deal exclusively with the data-level protocol.
func (*DataStream) Close ¶
func (s *DataStream) Close() error
func (*DataStream) Done ¶
func (s *DataStream) Done() <-chan struct{}
Return a channel that fires when the data session is severed.
func (*DataStream) Err ¶
func (s *DataStream) Err() error
func (*DataStream) LocalAddr ¶
func (s *DataStream) LocalAddr() net.Addr
func (*DataStream) RemoteAddr ¶
func (s *DataStream) RemoteAddr() net.Addr
func (*DataStream) SetDeadline ¶
func (s *DataStream) SetDeadline(t time.Time) error
func (*DataStream) SetReadDeadline ¶
func (s *DataStream) SetReadDeadline(t time.Time) error
See net.Conn#SetReadDeadline for semantics.
func (*DataStream) SetWriteDeadline ¶
func (s *DataStream) SetWriteDeadline(t time.Time) error
type IPAddress ¶
type IPAddress string
The net package represents an IP address as a byte slice, either 4 bytes for an IPv4 address or 16 bytes for IPv6. But []byte cannot be compared with ==, and for simplicity we want TransportAddress instances to be comparable. So instead we represent an IP address a string (which is really just an immutable byte slice), with the understanding that it will have length 4 for IPv4, length 16 for IPv6, or end with ".local" for unresolved ephemeral mDNS hostnames.
type PriorityTable ¶
type PriorityTable struct {
// contains filtered or unexported fields
}
type TransportAddress ¶
type TransportAddress struct {
// contains filtered or unexported fields
}
func (TransportAddress) String ¶
func (ta TransportAddress) String() string
type TransportProtocol ¶
type TransportProtocol string
Transport protocol is either "udp" or "tcp" (support for the latter is currently incomplete).