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 ¶
- func AcceptRawSocket(conn net.Conn, logger stdlog.StdLog, recvLimit int) (wamp.Peer, error)
- func ConnectRawSocketPeer(network, address string, serialization serialize.Serialization, ...) (wamp.Peer, error)
- func ConnectTlsRawSocketPeer(network, address string, serialization serialize.Serialization, ...) (wamp.Peer, error)
- func ConnectWebsocketPeer(url string, serialization serialize.Serialization, tlsConfig *tls.Config, ...) (wamp.Peer, error)
- func LinkedPeers() (wamp.Peer, wamp.Peer)
- func NewWebsocketPeer(conn *websocket.Conn, serializer serialize.Serializer, payloadType int, ...) wamp.Peer
- type DialFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptRawSocket ¶
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 ¶
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.