stdnet

package
v3.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: MIT Imports: 4 Imported by: 19

Documentation

Overview

Package stdnet implements the transport.Net interface using methods from Go's standard net package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Net

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

Net is an implementation of the net.Net interface based on functions of the standard net package.

func NewNet

func NewNet() (*Net, error)

NewNet creates a new StdNet instance.

func (*Net) CreateDialer

func (n *Net) CreateDialer(d *net.Dialer) transport.Dialer

CreateDialer creates an instance of vnet.Dialer

func (*Net) Dial

func (n *Net) Dial(network, address string) (net.Conn, error)

Dial connects to the address on the named network.

func (*Net) DialTCP

func (n *Net) DialTCP(network string, laddr, raddr *net.TCPAddr) (transport.TCPConn, error)

DialTCP acts like Dial for TCP networks.

func (*Net) DialUDP

func (n *Net) DialUDP(network string, laddr, raddr *net.UDPAddr) (transport.UDPConn, error)

DialUDP acts like Dial for UDP networks.

func (*Net) InterfaceByIndex

func (n *Net) InterfaceByIndex(index int) (*transport.Interface, error)

InterfaceByIndex returns the interface specified by index.

On Solaris, it returns one of the logical network interfaces sharing the logical data link; for more precision use InterfaceByName.

func (*Net) InterfaceByName

func (n *Net) InterfaceByName(name string) (*transport.Interface, error)

InterfaceByName returns the interface specified by name.

func (*Net) Interfaces

func (n *Net) Interfaces() ([]*transport.Interface, error)

Interfaces returns a slice of interfaces which are available on the system

func (*Net) ListenPacket

func (n *Net) ListenPacket(network string, address string) (net.PacketConn, error)

ListenPacket announces on the local network address.

func (*Net) ListenTCP

func (n *Net) ListenTCP(network string, laddr *net.TCPAddr) (transport.TCPListener, error)

ListenTCP acts like Listen for TCP networks.

func (*Net) ListenUDP

func (n *Net) ListenUDP(network string, locAddr *net.UDPAddr) (transport.UDPConn, error)

ListenUDP acts like ListenPacket for UDP networks.

func (*Net) ResolveIPAddr

func (n *Net) ResolveIPAddr(network, address string) (*net.IPAddr, error)

ResolveIPAddr returns an address of IP end point.

func (*Net) ResolveTCPAddr

func (n *Net) ResolveTCPAddr(network, address string) (*net.TCPAddr, error)

ResolveTCPAddr returns an address of TCP end point.

func (*Net) ResolveUDPAddr

func (n *Net) ResolveUDPAddr(network, address string) (*net.UDPAddr, error)

ResolveUDPAddr returns an address of UDP end point.

func (*Net) UpdateInterfaces

func (n *Net) UpdateInterfaces() error

UpdateInterfaces updates the internal list of network interfaces and associated addresses.

Jump to

Keyboard shortcuts

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