transport

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: MIT Imports: 12 Imported by: 15

Documentation

Overview

Package transport provides a websocket, rawsocket, and local transport implementation. The local transport is for in-process connection of a client to a router. Each transport implements the wamp.Peer interface, that connect Send and Recv methods to a particular transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcceptRawSocket

func AcceptRawSocket(conn net.Conn, logger stdlog.StdLog, recvLimit int) (wamp.Peer, error)

AcceptRawSocket handles the client handshake and returns a rawSocketPeer.

If recvLimit is > 0, then the client will not receive messages with size larger than the nearest power of 2 greater than or equal to recvLimit. If recvLimit is <= 0, then the default of 16M is used.

func ConnectRawSocketPeer

func ConnectRawSocketPeer(network, address string, serialization serialize.Serialization, logger stdlog.StdLog, recvLimit int) (wamp.Peer, error)

ConnectRawSocketPeer creates a new rawSocketPeer with the specified config, and connects it to the WAMP router at the specified address. The network and address parameters are documented here: https://golang.org/pkg/net/#Dial

If recvLimit is > 0, then the client will not receive messages with size larger than the nearest power of 2 greater than or equal to recvLimit. If recvLimit is <= 0, then the default of 16M is used.

func ConnectTlsRawSocketPeer

func ConnectTlsRawSocketPeer(network, address string, serialization serialize.Serialization, tlsConfig *tls.Config, logger stdlog.StdLog, recvLimit int) (wamp.Peer, error)

ConnectTlsRawSocketPeer creates a new rawSocketPeer with the specified config, and connects it, using TLS, to the WAMP router at the specified address. The network, address, and tlscfg parameters are documented here: https://golang.org/pkg/crypto/tls/#Dial

If recvLimit is > 0, then the client will not receive messages with size larger than the nearest power of 2 greater than or equal to recvLimit. If recvLimit is <= 0, then the default of 16M is used.

func ConnectWebsocketPeer

func ConnectWebsocketPeer(url string, serialization serialize.Serialization, tlsConfig *tls.Config, dial DialFunc, logger stdlog.StdLog) (wamp.Peer, error)

ConnectWebsocketPeer creates a new websocketPeer with the specified config, and connects it to the websocket server at the specified URL.

func LinkedPeers

func LinkedPeers() (wamp.Peer, wamp.Peer)

LinkedPeers creates two connected peers. Messages sent to one peer appear in the Recv of the other. This is used for connecting client sessions to the router.

func NewWebsocketPeer

func NewWebsocketPeer(conn *websocket.Conn, serializer serialize.Serializer, payloadType int, logger stdlog.StdLog) wamp.Peer

NewWebsocketPeer creates a websocket peer from an existing websocket connection. This is used by clients connecting to the WAMP router, and by servers to handle connections from clients.

Types

type DialFunc

type DialFunc func(network, addr string) (net.Conn, error)

Directories

Path Synopsis
Package serialize provides a Serializer interface with implementations that encode and decode message data in various ways.
Package serialize provides a Serializer interface with implementations that encode and decode message data in various ways.

Jump to

Keyboard shortcuts

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