tcp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package tcp implements the off-chain communication backend to initialize adapters for for tcp communication protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend is an off-chain communication backend that implements `CommBackend` for for tcp protocol. It stores configuration required for initializing the adapters.

func NewTCPBackend

func NewTCPBackend(dialerTimeout time.Duration) Backend

NewTCPBackend returns a backend that can initialize off-chain communication adapters for tcp protocol.

The provided dialerTimeout will be used when dialing for new outgoing connections. If the duration was set to zero, this program will not use any timeout. However default timeouts based on the operating system will still apply.

func (Backend) NewDialer

func (b Backend) NewDialer() perun.Dialer

NewDialer returns a dialer that can dial outgoing connections using on tcp protocol.

It uses the dial timeout configured during backend initialization. If the duration was set to zero, this program will not use any timeout. However default timeouts based on the operating system will still apply.

func (Backend) NewListener

func (b Backend) NewListener(addr string) (pnet.Listener, error)

NewListener returns a listener that can listen for incomig connections at the specified address using tcp protocol.

Jump to

Keyboard shortcuts

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