connection

package
v0.7.17 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accept

func Accept(fd int) (int, error)

Accept accepts an SCTP connection request

func NewSocket

func NewSocket(af int, mode types.SocketMode) (int, error)

NewSocket creates a new SCTP socket based on a given mode

func SCTPParseNotification

func SCTPParseNotification(b []byte) (*types.Notification, error)

SCTPParseNotification ...

func SCTPParseOOB

func SCTPParseOOB(b []byte) (*types.OOBMessage, error)

SCTPParseOOB ...

func WithAddressFamily

func WithAddressFamily(family types.AddressFamily) func(config *Config)

WithAddressFamily sets address family

func WithMode

func WithMode(mode types.SocketMode) func(config *Config)

WithMode sets SCTP mode

func WithNonBlocking

func WithNonBlocking(nonblocking bool) func(config *Config)

WithNonBlocking sets nonblocking

func WithOptions

func WithOptions(initMsg types.InitMsg) func(config *Config)

WithOptions sets options

Types

type Config

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

Config sctp connection config

func NewConfig

func NewConfig(options ...func(cfg *Config)) *Config

NewConfig creates a connection config

type GetAddrs

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

GetAddrs ...

type PeeloffArg

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

PeeloffArg ...

type SCTPConn

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

SCTPConn SCTP connection data structure

func NewSCTPConnection

func NewSCTPConnection(cfg *Config) (*SCTPConn, error)

NewSCTPConnection creates an SCTP connection

func (*SCTPConn) Bind

func (c *SCTPConn) Bind(laddr *addressing.Address) error

Bind binds SCTP socket to an address

func (*SCTPConn) Close

func (c *SCTPConn) Close() error

Close closes an SCTP connection

func (*SCTPConn) Connect

func (c *SCTPConn) Connect(raddr *addressing.Address) error

Connect connects to an SCTP endpoint

func (*SCTPConn) FD

func (c *SCTPConn) FD() int

FD returns socket file descriptor

func (*SCTPConn) GetDefaultSentParam

func (c *SCTPConn) GetDefaultSentParam() (*types.SndRcvInfo, error)

GetDefaultSentParam gets default sending parameters

func (*SCTPConn) GetEvents

func (c *SCTPConn) GetEvents() (int, error)

GetEvents gets SCTP connection events

func (*SCTPConn) GetNonblocking

func (c *SCTPConn) GetNonblocking() (bool, error)

GetNonblocking get nonblocking status

func (*SCTPConn) GetSocketMode

func (c *SCTPConn) GetSocketMode() (types.SocketMode, error)

GetSocketMode gets SCTP socket mode

func (*SCTPConn) Listen

func (c *SCTPConn) Listen() error

Listen listens on a SCTP socket

func (*SCTPConn) LocalAddr

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

LocalAddr returns local address

func (*SCTPConn) PeelOff

func (c *SCTPConn) PeelOff(id int32) (*SCTPConn, error)

PeelOff peels off SCTP connection

func (*SCTPConn) Read

func (c *SCTPConn) Read(b []byte) (int, error)

Read reads on an SCTP connection

func (*SCTPConn) RemoteAddr

func (c *SCTPConn) RemoteAddr() net.Addr

RemoteAddr gets remote address

func (*SCTPConn) SCTPGetPrimaryPeerAddr

func (c *SCTPConn) SCTPGetPrimaryPeerAddr() (*addressing.Address, error)

SCTPGetPrimaryPeerAddr returns SCTP primary peer address

func (*SCTPConn) SCTPLocalAddr

func (c *SCTPConn) SCTPLocalAddr(id uint16) (*addressing.Address, error)

SCTPLocalAddr returns SCTP local address

func (*SCTPConn) SCTPRead

func (c *SCTPConn) SCTPRead(b []byte) (int, *types.OOBMessage, int, error)

SCTPRead reads from a SCTP connection

func (*SCTPConn) SCTPRemoteAddr

func (c *SCTPConn) SCTPRemoteAddr(id uint16) (*addressing.Address, error)

SCTPRemoteAddr returns SCTP remote address

func (*SCTPConn) SCTPWrite

func (c *SCTPConn) SCTPWrite(b []byte, info *types.SndRcvInfo) (int, error)

SCTPWrite writes on SCTP connection

func (*SCTPConn) SetDeadline

func (c *SCTPConn) SetDeadline(t time.Time) error

SetDeadline sets deadline for SCTP connection

func (*SCTPConn) SetDefaultSentParam

func (c *SCTPConn) SetDefaultSentParam(info *types.SndRcvInfo) error

SetDefaultSentParam sets default sending parameters

func (*SCTPConn) SetEvents

func (c *SCTPConn) SetEvents(events ...types.Event) error

SetEvents set SCTP connection events

func (*SCTPConn) SetFD

func (c *SCTPConn) SetFD(fd int32)

SetFD sets socket file descriptor

func (*SCTPConn) SetNonblocking

func (c *SCTPConn) SetNonblocking(val bool) error

SetNonblocking sets nonblocking connection

func (*SCTPConn) SetReadDeadline

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

SetReadDeadline sets read deadline

func (*SCTPConn) SetWriteDeadline

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

SetWriteDeadline sets write deadline

func (*SCTPConn) Write

func (c *SCTPConn) Write(b []byte) (int, error)

Write writes on an SCTP connection

Jump to

Keyboard shortcuts

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