client

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClientPreamble is the preamble to send before upgrading
	// the connection into a SCADA version 1 connection.
	ClientPreamble = "SCADA 1\n"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a SCADA compatible client. This is a bare bones client that only handles the framing and RPC protocol. Higher-level clients should be preferred.

func DialOpts

func DialOpts(target string, opts *Opts) (*Client, error)

DialOpts is a parameterized Dial.

func DialOptsContext

func DialOptsContext(ctx context.Context, target string, opts *Opts) (*Client, error)

DialOptsContext is a parameterized Dial.

func (*Client) Accept

func (c *Client) Accept() (net.Conn, error)

Accept is used to accept an incoming connection.

func (*Client) Addr

func (c *Client) Addr() net.Addr

Addr is so that client can act like a net.Listener.

func (*Client) Close

func (c *Client) Close() error

Close is used to terminate the client connection.

func (*Client) NumStreams

func (c *Client) NumStreams() int

NumStreams returns the number of open streams on the client.

func (*Client) Open

func (c *Client) Open() (net.Conn, error)

Open is used to open an outgoing connection.

func (*Client) RPC

func (c *Client) RPC(method string, args interface{}, resp interface{}) error

RPC performs a RPC call.

type Opts

type Opts struct {
	// Dialer is the Dialer used to make a network connection.
	Dialer dialer.Dialer

	// Modifies the log output
	LogOutput io.Writer
}

Opts is used to parameterize a Dial.

Directories

Path Synopsis
tcp

Jump to

Keyboard shortcuts

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