trireme-lib: Index | Files

package protomux

import ""


Package Files


type MultiplexedListener Uses

type MultiplexedListener struct {
    // contains filtered or unexported fields

MultiplexedListener is the root listener that will split connections to different protocols.

func NewMultiplexedListener Uses

func NewMultiplexedListener(l net.Listener, mark int, registry *serviceregistry.Registry, puID string) *MultiplexedListener

NewMultiplexedListener returns a new multiplexed listener. Caller must register protocols outside of the new object creation.

func (*MultiplexedListener) Close Uses

func (m *MultiplexedListener) Close()

Close terminates the server without the context.

func (*MultiplexedListener) RegisterDefaultListener Uses

func (m *MultiplexedListener) RegisterDefaultListener(p *ProtoListener) error

RegisterDefaultListener registers a default listener.

func (*MultiplexedListener) RegisterListener Uses

func (m *MultiplexedListener) RegisterListener(ltype common.ListenerType) (*ProtoListener, error)

RegisterListener registers a new listener. It returns the listener that the various protocol servers should use. If defaultListener is set, this will become the default listener if no match is found. Obviously, there cannot be more than one default.

func (*MultiplexedListener) Serve Uses

func (m *MultiplexedListener) Serve(ctx context.Context) error

Serve will demux the connections

func (*MultiplexedListener) UnregisterDefaultListener Uses

func (m *MultiplexedListener) UnregisterDefaultListener() error

UnregisterDefaultListener unregisters the default listener.

func (*MultiplexedListener) UnregisterListener Uses

func (m *MultiplexedListener) UnregisterListener(ltype common.ListenerType) error

UnregisterListener unregisters a listener. It returns an error if there are services associated with this listener.

type ProtoListener Uses

type ProtoListener struct {
    // contains filtered or unexported fields

ProtoListener is

func NewProtoListener Uses

func NewProtoListener(mark int) *ProtoListener

NewProtoListener creates a listener for a particular protocol.

func (*ProtoListener) Accept Uses

func (p *ProtoListener) Accept() (net.Conn, error)

Accept accepts new connections over the channel.

Package protomux imports 9 packages (graph) and is imported by 6 packages. Updated 2020-04-03. Refresh now. Tools for package owners.