tcp

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateTLSConfig = createTLSConfig

Functions

This section is empty.

Types

type Addr

type Addr struct {
	Hostname string
}

func (Addr) Network

func (addr Addr) Network() string

func (Addr) String

func (addr Addr) String() string

type Transport

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

Transport is the network layer for inter-node communications.

func NewTLSTransport

func NewTLSTransport(certFile, keyPath string, skipVerify bool) *Transport

NewTLSTransport returns an initialized TLS-encrypted Transport.

func NewTransport

func NewTransport() *Transport

NewTransport returns an initialized unencrypted Transport.

func NewTransportFromListener

func NewTransportFromListener(ln net.Listener, remoteEncrypted bool, skipVerify bool, addr string) *Transport

NewTransportFromListener returns an initialized Transport

func (*Transport) Accept

func (t *Transport) Accept() (net.Conn, error)

Accept waits for the next connection.

func (*Transport) Addr

func (t *Transport) Addr() net.Addr

Addr returns the binding address of the transport.

func (*Transport) Close

func (t *Transport) Close() error

Close closes the transport

func (*Transport) Dial

func (t *Transport) Dial(addr string, timeout time.Duration) (net.Conn, error)

Dial opens a network connection.

func (*Transport) Open

func (t *Transport) Open(addr string) error

Open opens the transport, binding to the supplied address.

Jump to

Keyboard shortcuts

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