socketinfo

package module
v0.0.0-...-9e9a74e Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2017 License: MIT Imports: 2 Imported by: 0

README

socketinfo GoDoc

socketinfo provides additional info on socket file descriptors in Go (golang)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSocket = errors.New("not a socket")

Functions

This section is empty.

Types

type ProtocolFamily

type ProtocolFamily uint16
const (
	Unspecified ProtocolFamily = syscall.AF_UNSPEC
	Unix        ProtocolFamily = syscall.AF_UNIX  // Unix domain sockets
	IPv4        ProtocolFamily = syscall.AF_INET  // Internet Protocol v4
	IPv6        ProtocolFamily = syscall.AF_INET6 // Internet Protocol v6
)

type SocketInfo

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

func New

func New(fd int) SocketInfo

func (*SocketInfo) Listening

func (s *SocketInfo) Listening() (listening bool, err error)

func (*SocketInfo) Type

func (s *SocketInfo) Type() (st SocketType, err error)

type SocketType

type SocketType uint16
const (
	Stream    SocketType = syscall.SOCK_STREAM    // stream (connection) socket
	Datagram  SocketType = syscall.SOCK_DGRAM     // datagram (connection-less) socket
	Raw       SocketType = syscall.SOCK_RAW       // raw socket
	SeqPacket SocketType = syscall.SOCK_SEQPACKET // sequential packet socket

)

Jump to

Keyboard shortcuts

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