iface

package
v0.0.0-...-51876cf Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: MPL-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// UDPSocket iface
	UDPSocket int = 0
	// AFPacket iface
	AFPacket int = 1
	// NetMap iface
	NetMap int = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Iface

type Iface interface {
	Read(queue int) (*common.Packet, error)
	Write(queue int, payload *common.Packet) error
	Open() error
	Close() error
	GetFDs() []int
}

Iface is a generic multi-queue networking interface

func New

func New(kind int, log *common.Logger, cfg *common.Config) Iface

New Iface object

type Socket

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

Socket is a generic multique socket

func (*Socket) Close

func (sock *Socket) Close() error

Close the socket

func (*Socket) GetFDs

func (sock *Socket) GetFDs() []int

GetFDs will return the underlying queue fds

func (*Socket) Open

func (sock *Socket) Open() error

Open the socket

func (*Socket) Read

func (sock *Socket) Read(queue int) (*common.Packet, error)

Read a packet from the socket

func (*Socket) Write

func (sock *Socket) Write(queue int, packet *common.Packet) error

Write a packet to the socket

Jump to

Keyboard shortcuts

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