transport

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PacketTransport

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

PacketTransport implements interface Transport by wrapping around a net.PacketConn. The reliability of the underlying net.PacketConn defines the semantics behind SendMsgTo and SendUnreliableMsgTo.

For PacketTransports running on top of UDP, both SendMsgTo and SendUnreliableMsgTo are unreliable.

For PacketTransports running on top of UNIX domain socket with SOCK_DGRAM or Reliable socket, both SendMsgTo and SendUnreliableMsgTo guarantee reliable delivery to the other other end of the socket. Note that in this case, the reliability only extends to the guarantee that the message was not lost in transfer. It is not a guarantee that the server has read and processed the message.

func NewPacketTransport

func NewPacketTransport(conn net.PacketConn) *PacketTransport

func (*PacketTransport) Close

func (*PacketTransport) RecvFrom

func (u *PacketTransport) RecvFrom(ctx context.Context) (common.RawBytes, net.Addr, error)

func (*PacketTransport) SendMsgTo

func (u *PacketTransport) SendMsgTo(ctx context.Context, b common.RawBytes,
	address net.Addr) error

func (*PacketTransport) SendUnreliableMsgTo

func (u *PacketTransport) SendUnreliableMsgTo(ctx context.Context, b common.RawBytes,
	address net.Addr) error

Jump to

Keyboard shortcuts

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