Version: v1.18.0 Latest Latest

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

Go to latest
Published: Dec 8, 2019 License: Apache-2.0 Imports: 3 Imported by: 4



Package socket provides a pseudo socket



This section is empty.


This section is empty.


This section is empty.


type Pool added in v1.17.1

type Pool struct {
	// contains filtered or unexported fields

func NewPool added in v1.17.1

func NewPool() *Pool

NewPool returns a new socket pool

func (*Pool) Close added in v1.17.1

func (p *Pool) Close()

Close the pool and delete all the sockets

func (*Pool) Get added in v1.17.1

func (p *Pool) Get(id string) (*Socket, bool)

func (*Pool) Release added in v1.17.1

func (p *Pool) Release(s *Socket)

type Socket

type Socket struct {
	// contains filtered or unexported fields

Socket is our pseudo socket for transport.Socket

func New

func New(id string) *Socket

New returns a new pseudo socket which can be used in the place of a transport socket. Messages are sent to the socket via Accept and receives from the socket via Process. SetLocal/SetRemote should be called before using the socket.

func (*Socket) Accept

func (s *Socket) Accept(m *transport.Message) error

Accept passes a message to the socket which will be processed by the call to Recv

func (*Socket) Close

func (s *Socket) Close() error

Close closes the socket

func (*Socket) Local

func (s *Socket) Local() string

func (*Socket) Process

func (s *Socket) Process(m *transport.Message) error

Process takes the next message off the send queue created by a call to Send

func (*Socket) Recv

func (s *Socket) Recv(m *transport.Message) error

func (*Socket) Remote

func (s *Socket) Remote() string

func (*Socket) Send

func (s *Socket) Send(m *transport.Message) error

func (*Socket) SetLocal

func (s *Socket) SetLocal(l string)

func (*Socket) SetRemote

func (s *Socket) SetRemote(r string)

Source Files

Jump to

Keyboard shortcuts

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