pconn

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 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 Link = transport_quic.Link

Link is a Quic-based connection/link backed by a packet connection.

type Opts

type Opts struct {
	// Quic are the quic protocol options.
	Quic *quic.Opts `protobuf:"bytes,1,opt,name=quic,proto3" json:"quic,omitempty"`
	// Verbose turns on verbose debug logging.
	Verbose              bool     `protobuf:"varint,2,opt,name=verbose,proto3" json:"verbose,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Opts are extra options for the packet conn.

func (*Opts) Descriptor

func (*Opts) Descriptor() ([]byte, []int)

func (*Opts) GetQuic

func (m *Opts) GetQuic() *quic.Opts

func (*Opts) GetVerbose

func (m *Opts) GetVerbose() bool

func (*Opts) ProtoMessage

func (*Opts) ProtoMessage()

func (*Opts) Reset

func (m *Opts) Reset()

func (*Opts) String

func (m *Opts) String() string

func (*Opts) XXX_DiscardUnknown

func (m *Opts) XXX_DiscardUnknown()

func (*Opts) XXX_Marshal

func (m *Opts) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Opts) XXX_Merge

func (m *Opts) XXX_Merge(src proto.Message)

func (*Opts) XXX_Size

func (m *Opts) XXX_Size() int

func (*Opts) XXX_Unmarshal

func (m *Opts) XXX_Unmarshal(b []byte) error

type Transport

type Transport struct {
	// Transport is the underlying quic transport
	*transport_quic.Transport
	// contains filtered or unexported fields
}

Transport implements a bifrost transport with a Quic-based packet conn. Transport UUIDs are deterministic and based on the LocalAddr() of the pconn.

func NewTransport

func NewTransport(
	ctx context.Context,
	le *logrus.Entry,
	privKey crypto.PrivKey,
	tc transport.TransportHandler,
	opts *Opts,

	uuid uint64,

	pc net.PacketConn,

	addrParser func(addr string) (net.Addr, error),
) (*Transport, error)

NewTransport constructs a new packet-conn based transport.

func (*Transport) Close

func (t *Transport) Close() error

Close closes the transport, returning any errors closing.

func (*Transport) Execute

func (t *Transport) Execute(ctx context.Context) error

Execute executes the transport as configured, returning any fatal error.

func (*Transport) GetPeerID

func (t *Transport) GetPeerID() peer.ID

GetPeerID returns the peer ID.

Jump to

Keyboard shortcuts

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