connection

package
v0.0.0-...-379887d Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Version   pvdata.PVByte
	Direction pvdata.PVUByte
	// contains filtered or unexported fields
}

func New

func New(conn io.ReadWriter, direction pvdata.PVUByte) *Connection

func (*Connection) Next

func (c *Connection) Next(ctx context.Context) (*Message, error)

func (*Connection) ReceiveBufferSize

func (c *Connection) ReceiveBufferSize() int

func (*Connection) SendApp

func (c *Connection) SendApp(ctx context.Context, messageCommand pvdata.PVByte, payload interface{}) error

SendApp sends an application message on the wire. payload must be something that can be passed to pvdata.Encode; i.e. it must be either an instance of PVField or a pointer to something that can be converted to a PVField. If payload is a []byte it will be sent raw. It is safe to call SendApp from any goroutine.

func (*Connection) SendCtrl

func (c *Connection) SendCtrl(ctx context.Context, messageCommand pvdata.PVByte, payloadSize pvdata.PVInt) error

SendCtrl sends a control message on the wire. It is safe to call SendCtrl from any goroutine.

type Message

type Message struct {
	Header proto.PVAccessHeader
	Data   []byte
	// contains filtered or unexported fields
}

func (*Message) Decode

func (msg *Message) Decode(out interface{}) error

Decode decodes data from msg into out using the connection's established decoder state.

Jump to

Keyboard shortcuts

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