socket

package
v0.0.0-...-70695b7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2021 License: MPL-2.0 Imports: 14 Imported by: 0

README

socket - rdtp socket abstraction

Documentation license

// TODO

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LocalAddr  *rdtp.Addr // local rdtp address
	RemoteAddr *rdtp.Addr // remote rdtp address

	// connection to app layer
	Application net.Conn

	// connection to network layer
	Network network.Network
}

Config is the necessary configuration to initialize a socket

type Socket

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

Socket represents a socket abstraction and carries all necessary info and statistics about the socket

func New

func New(c Config) (*Socket, error)

New is the socket constructor

func (*Socket) Accept

func (s *Socket) Accept() error

Accept sends a SYN ACK and waits for an ACK

func (*Socket) Close

func (s *Socket) Close()

Close closes a socket

func (*Socket) Deliver

func (s *Socket) Deliver(p *packet.Packet)

Deliver delivers a packet to a socket's inbound packet channel

func (*Socket) Dial

func (s *Socket) Dial() error

Dial sends a SYN, waits for a SYN ACK, and sends an ACK

func (*Socket) ID

func (s *Socket) ID() string

ID returns the of unique identifier of the socket

func (*Socket) LocalAddr

func (s *Socket) LocalAddr() net.Addr

LocalAddr returns the local network address.

func (*Socket) RemoteAddr

func (s *Socket) RemoteAddr() net.Addr

RemoteAddr returns the remote network address.

func (*Socket) Run

func (s *Socket) Run()

Run kicks-off socket processes

Jump to

Keyboard shortcuts

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