multicast

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package multicast contains multicast connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterfaceForSource

func InterfaceForSource(ip net.IP) (*net.Interface, error)

InterfaceForSource returns a multicast-capable interface that can communicate with given IP.

Types

type Conn

type Conn interface {
	net.PacketConn
	SetReadBuffer(int) error
}

Conn is a Multicast connection.

func NewMultiConn

func NewMultiConn(
	address string,
	listenPacket func(network, address string) (net.PacketConn, error),
) (Conn, error)

NewMultiConn allocates a MultiConn.

func NewSingleConn

func NewSingleConn(
	intf *net.Interface,
	address string,
	listenPacket func(network, address string) (net.PacketConn, error),
) (Conn, error)

NewSingleConn allocates a SingleConn.

type MultiConn

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

MultiConn is a multicast connection that works in parallel on all interfaces.

func (*MultiConn) Close

func (c *MultiConn) Close() error

Close implements Conn.

func (*MultiConn) LocalAddr

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

LocalAddr implements Conn.

func (*MultiConn) ReadFrom

func (c *MultiConn) ReadFrom(b []byte) (int, net.Addr, error)

ReadFrom implements Conn.

func (*MultiConn) SetDeadline

func (c *MultiConn) SetDeadline(_ time.Time) error

SetDeadline implements Conn.

func (*MultiConn) SetReadBuffer

func (c *MultiConn) SetReadBuffer(bytes int) error

SetReadBuffer implements Conn.

func (*MultiConn) SetReadDeadline

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

SetReadDeadline implements Conn.

func (*MultiConn) SetWriteDeadline

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

SetWriteDeadline implements Conn.

func (*MultiConn) WriteTo

func (c *MultiConn) WriteTo(b []byte, addr net.Addr) (int, error)

WriteTo implements Conn.

type SingleConn

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

SingleConn is a multicast connection that works on a single interface.

func (*SingleConn) Close

func (c *SingleConn) Close() error

Close implements Conn.

func (*SingleConn) LocalAddr

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

LocalAddr implements Conn.

func (*SingleConn) ReadFrom

func (c *SingleConn) ReadFrom(b []byte) (int, net.Addr, error)

ReadFrom implements Conn.

func (*SingleConn) SetDeadline

func (c *SingleConn) SetDeadline(_ time.Time) error

SetDeadline implements Conn.

func (*SingleConn) SetReadBuffer

func (c *SingleConn) SetReadBuffer(bytes int) error

SetReadBuffer implements Conn.

func (*SingleConn) SetReadDeadline

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

SetReadDeadline implements Conn.

func (*SingleConn) SetWriteDeadline

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

SetWriteDeadline implements Conn.

func (*SingleConn) WriteTo

func (c *SingleConn) WriteTo(b []byte, addr net.Addr) (int, error)

WriteTo implements Conn.

Jump to

Keyboard shortcuts

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