Documentation
¶
Overview ¶
A Go interface to ZeroMQ (zmq, 0mq) version 3.
For ZeroMQ version 4, see: http://github.com/pebbe/zmq4
For ZeroMQ version 2, see: http://github.com/pebbe/zmq2
See also the wiki (for zmq4): https://github.com/pebbe/zmq4/wiki
A note on the use of a context:
This package provides a default context. This is what will be used by the functions without a context receiver, that create a socket or manipulate the context. Package developers that import this package should probably not use the default context with its associated functions, but create their own context(s). See: type Context.
Index ¶
- Constants
- Variables
- func Error(e int) string
- func GetIoThreads() (int, error)
- func GetMaxSockets() (int, error)
- func Proxy(frontend, backend, capture *Socket) error
- func SetIoThreads(n int) error
- func SetMaxSockets(n int) error
- func Term() error
- func Version() (major, minor, patch int)
- type Context
- type Errno
- type Event
- type Flag
- type Polled
- type Poller
- func (p *Poller) Add(soc *Socket, events State) int
- func (p *Poller) Poll(timeout time.Duration) ([]Polled, error)
- func (p *Poller) PollAll(timeout time.Duration) ([]Polled, error)
- func (p *Poller) Remove(id int) error
- func (p *Poller) RemoveBySocket(soc *Socket) error
- func (p *Poller) String() string
- func (p *Poller) Update(id int, events State) (previous State, err error)
- func (p *Poller) UpdateBySocket(soc *Socket, events State) (previous State, err error)
- type Reactor
- func (r *Reactor) AddChannel(ch <-chan interface{}, limit int, handler func(interface{}) error) (id uint64)
- func (r *Reactor) AddChannelTime(ch <-chan time.Time, limit int, handler func(interface{}) error) (id uint64)
- func (r *Reactor) AddSocket(soc *Socket, events State, handler func(State) error)
- func (r *Reactor) RemoveChannel(id uint64)
- func (r *Reactor) RemoveSocket(soc *Socket)
- func (r *Reactor) Run(interval time.Duration) (err error)
- func (r *Reactor) SetVerbose(verbose bool)
- type Socket
- func (soc *Socket) Bind(endpoint string) error
- func (soc *Socket) Close() error
- func (soc *Socket) Connect(endpoint string) error
- func (soc *Socket) Context() (*Context, error)
- func (soc *Socket) Disconnect(endpoint string) error
- func (soc *Socket) GetAffinity() (uint64, error)
- func (soc *Socket) GetBacklog() (int, error)
- func (soc *Socket) GetDelayAttachOnConnect() (bool, error)
- func (soc *Socket) GetEvents() (State, error)
- func (soc *Socket) GetFd() (int, error)
- func (soc *Socket) GetIdentity() (string, error)
- func (soc *Socket) GetIpv4only() (bool, error)
- func (soc *Socket) GetLastEndpoint() (string, error)
- func (soc *Socket) GetLinger() (time.Duration, error)
- func (soc *Socket) GetMaxmsgsize() (int64, error)
- func (soc *Socket) GetMulticastHops() (int, error)
- func (soc *Socket) GetRate() (int, error)
- func (soc *Socket) GetRcvbuf() (int, error)
- func (soc *Socket) GetRcvhwm() (int, error)
- func (soc *Socket) GetRcvmore() (bool, error)
- func (soc *Socket) GetRcvtimeo() (time.Duration, error)
- func (soc *Socket) GetReconnectIvl() (time.Duration, error)
- func (soc *Socket) GetReconnectIvlMax() (time.Duration, error)
- func (soc *Socket) GetRecoveryIvl() (time.Duration, error)
- func (soc *Socket) GetSndbuf() (int, error)
- func (soc *Socket) GetSndhwm() (int, error)
- func (soc *Socket) GetSndtimeo() (time.Duration, error)
- func (soc *Socket) GetTcpKeepalive() (int, error)
- func (soc *Socket) GetTcpKeepaliveCnt() (int, error)
- func (soc *Socket) GetTcpKeepaliveIdle() (int, error)
- func (soc *Socket) GetTcpKeepaliveIntvl() (int, error)
- func (soc *Socket) GetType() (Type, error)
- func (soc *Socket) Monitor(addr string, events Event) error
- func (soc *Socket) Recv(flags Flag) (string, error)
- func (soc *Socket) RecvBytes(flags Flag) ([]byte, error)
- func (soc *Socket) RecvEvent(flags Flag) (event_type Event, addr string, value int, err error)
- func (soc *Socket) RecvMessage(flags Flag) (msg []string, err error)
- func (soc *Socket) RecvMessageBytes(flags Flag) (msg [][]byte, err error)
- func (soc *Socket) Send(data string, flags Flag) (int, error)
- func (soc *Socket) SendBytes(data []byte, flags Flag) (int, error)
- func (soc *Socket) SendMessage(parts ...interface{}) (total int, err error)
- func (soc *Socket) SendMessageDontwait(parts ...interface{}) (total int, err error)
- func (soc *Socket) SetAffinity(value uint64) error
- func (soc *Socket) SetBacklog(value int) error
- func (soc *Socket) SetDelayAttachOnConnect(value bool) error
- func (soc *Socket) SetIdentity(value string) error
- func (soc *Socket) SetIpv4only(value bool) error
- func (soc *Socket) SetLinger(value time.Duration) error
- func (soc *Socket) SetMaxmsgsize(value int64) error
- func (soc *Socket) SetMulticastHops(value int) error
- func (soc *Socket) SetRate(value int) error
- func (soc *Socket) SetRcvbuf(value int) error
- func (soc *Socket) SetRcvhwm(value int) error
- func (soc *Socket) SetRcvtimeo(value time.Duration) error
- func (soc *Socket) SetReconnectIvl(value time.Duration) error
- func (soc *Socket) SetReconnectIvlMax(value time.Duration) error
- func (soc *Socket) SetRecoveryIvl(value time.Duration) error
- func (soc *Socket) SetRouterMandatory(value int) error
- func (soc *Socket) SetSndbuf(value int) error
- func (soc *Socket) SetSndhwm(value int) error
- func (soc *Socket) SetSndtimeo(value time.Duration) error
- func (soc *Socket) SetSubscribe(filter string) error
- func (soc *Socket) SetTcpAcceptFilter(filter string) error
- func (soc *Socket) SetTcpKeepalive(value int) error
- func (soc *Socket) SetTcpKeepaliveCnt(value int) error
- func (soc *Socket) SetTcpKeepaliveIdle(value int) error
- func (soc *Socket) SetTcpKeepaliveIntvl(value int) error
- func (soc *Socket) SetUnsubscribe(filter string) error
- func (soc *Socket) SetXpubVerbose(value int) error
- func (soc Socket) String() string
- func (soc *Socket) Unbind(endpoint string) error
- type State
- type Type
Constants ¶
const ( // On Windows platform some of the standard POSIX errnos are not defined. EADDRINUSE = Errno(C.EADDRINUSE) EADDRNOTAVAIL = Errno(C.EADDRNOTAVAIL) EAFNOSUPPORT = Errno(C.EAFNOSUPPORT) ECONNABORTED = Errno(C.ECONNABORTED) ECONNREFUSED = Errno(C.ECONNREFUSED) ECONNRESET = Errno(C.ECONNRESET) EHOSTUNREACH = Errno(C.EHOSTUNREACH) EINPROGRESS = Errno(C.EINPROGRESS) EMSGSIZE = Errno(C.EMSGSIZE) ENETDOWN = Errno(C.ENETDOWN) ENETRESET = Errno(C.ENETRESET) ENETUNREACH = Errno(C.ENETUNREACH) ENOBUFS = Errno(C.ENOBUFS) ENOTCONN = Errno(C.ENOTCONN) ENOTSOCK = Errno(C.ENOTSOCK) ENOTSUP = Errno(C.ENOTSUP) EPROTONOSUPPORT = Errno(C.EPROTONOSUPPORT) ETIMEDOUT = Errno(C.ETIMEDOUT) // Native 0MQ error codes. EFSM = Errno(C.EFSM) EMTHREAD = Errno(C.EMTHREAD) ENOCOMPATPROTO = Errno(C.ENOCOMPATPROTO) ETERM = Errno(C.ETERM) )
const ( // Constants for NewSocket() // See: http://api.zeromq.org/3-2:zmq-socket#toc3 REQ = Type(C.ZMQ_REQ) REP = Type(C.ZMQ_REP) DEALER = Type(C.ZMQ_DEALER) ROUTER = Type(C.ZMQ_ROUTER) PUB = Type(C.ZMQ_PUB) SUB = Type(C.ZMQ_SUB) XPUB = Type(C.ZMQ_XPUB) XSUB = Type(C.ZMQ_XSUB) PUSH = Type(C.ZMQ_PUSH) PULL = Type(C.ZMQ_PULL) PAIR = Type(C.ZMQ_PAIR) )
const ( // Flags for (*Socket)Send(), (*Socket)Recv() // For Send, see: http://api.zeromq.org/3-2:zmq-send#toc2 // For Recv, see: http://api.zeromq.org/3-2:zmq-msg-recv#toc2 DONTWAIT = Flag(C.ZMQ_DONTWAIT) SNDMORE = Flag(C.ZMQ_SNDMORE) )
const ( // Flags for (*Socket)Monitor() and (*Socket)RecvEvent() // See: http://api.zeromq.org/3-2:zmq-socket-monitor#toc2 EVENT_ALL = Event(C.ZMQ_EVENT_ALL) EVENT_CONNECTED = Event(C.ZMQ_EVENT_CONNECTED) EVENT_CONNECT_DELAYED = Event(C.ZMQ_EVENT_CONNECT_DELAYED) EVENT_CONNECT_RETRIED = Event(C.ZMQ_EVENT_CONNECT_RETRIED) EVENT_LISTENING = Event(C.ZMQ_EVENT_LISTENING) EVENT_BIND_FAILED = Event(C.ZMQ_EVENT_BIND_FAILED) EVENT_ACCEPTED = Event(C.ZMQ_EVENT_ACCEPTED) EVENT_ACCEPT_FAILED = Event(C.ZMQ_EVENT_ACCEPT_FAILED) EVENT_CLOSED = Event(C.ZMQ_EVENT_CLOSED) EVENT_CLOSE_FAILED = Event(C.ZMQ_EVENT_CLOSE_FAILED) EVENT_DISCONNECTED = Event(C.ZMQ_EVENT_DISCONNECTED) )
const ( // Flags for (*Socket)GetEvents() // See: http://api.zeromq.org/3-2:zmq-getsockopt#toc24 POLLIN = State(C.ZMQ_POLLIN) POLLOUT = State(C.ZMQ_POLLOUT) )
Variables ¶
Functions ¶
func GetIoThreads ¶
Returns the size of the 0MQ thread pool in the default context.
func GetMaxSockets ¶
Returns the maximum number of sockets allowed in the default context.
func Proxy ¶
Start built-in ØMQ proxy
func SetIoThreads ¶
Specifies the size of the 0MQ thread pool to handle I/O operations in the default context. If your application is using only the inproc transport for messaging you may set this to zero, otherwise set it to at least one. This option only applies before creating any sockets.
Default value: 1
func SetMaxSockets ¶
Sets the maximum number of sockets allowed in the default context.
Default value: 1024
func Term ¶
func Term() error
Terminates the default context.
For linger behavior, see: http://api.zeromq.org/3-2:zmq-ctx-destroy
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
A context that is not the default context.
func (*Context) GetIoThreads ¶
Returns the size of the 0MQ thread pool.
func (*Context) GetMaxSockets ¶
Returns the maximum number of sockets allowed.
func (*Context) NewSocket ¶
Create 0MQ socket in the given context.
WARNING: The Socket is not thread safe. This means that you cannot access the same Socket from different goroutines without using something like a mutex.
For a description of socket types, see: http://api.zeromq.org/3-2:zmq-socket#toc3
func (*Context) SetIoThreads ¶
Specifies the size of the 0MQ thread pool to handle I/O operations. If your application is using only the inproc transport for messaging you may set this to zero, otherwise set it to at least one. This option only applies before creating any sockets.
Default value: 1
func (*Context) Term ¶
Terminates the context.
For linger behavior, see: http://api.zeromq.org/3-2:zmq-ctx-destroy
type Errno ¶
type Errno uintptr
An Errno is an unsigned number describing an error condition as returned by a call to ZeroMQ. It implements the error interface. The number is either a standard system error, or an error defined by the C library of ZeroMQ.
func AsErrno ¶
Convert error to Errno.
Example usage:
switch AsErrno(err) { case zmq.Errno(syscall.EINTR): // standard system error // call was interrupted case zmq.ETERM: // error defined by ZeroMQ // context was terminated }
See also: examples/interrupt.go
type Polled ¶
type Polled struct { Socket *Socket // socket with matched event(s) Events State // actual matched event(s) }
Return type for (*Poller)Poll
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
func (*Poller) Add ¶
Add items to the poller
Events is a bitwise OR of zmq.POLLIN and zmq.POLLOUT ¶
Returns the id of the item, which can be used as a handle to (*Poller)Update and as an index into the result of (*Poller)PollAll
func (*Poller) Poll ¶
Input/output multiplexing
If timeout < 0, wait forever until a matching event is detected
Only sockets with matching socket events are returned in the list.
Example:
poller := zmq.NewPoller() poller.Add(socket0, zmq.POLLIN) poller.Add(socket1, zmq.POLLIN) // Process messages from both sockets for { sockets, _ := poller.Poll(-1) for _, socket := range sockets { switch s := socket.Socket; s { case socket0: msg, _ := s.Recv(0) // Process msg case socket1: msg, _ := s.Recv(0) // Process msg } } }
func (*Poller) PollAll ¶
This is like (*Poller)Poll, but it returns a list of all sockets, in the same order as they were added to the poller, not just those sockets that had an event.
For each socket in the list, you have to check the Events field to see if there was actually an event.
When error is not nil, the return list contains no sockets.
func (*Poller) Remove ¶
Remove a socket from the poller
Returns ErrorNoSocket if the id was out of range
func (*Poller) RemoveBySocket ¶
Remove a socket from the poller
Returns ErrorNoSocket if the socket didn't match
func (*Poller) Update ¶
Update the events mask of a socket in the poller
Replaces the Poller's bitmask for the specified id with the events parameter passed ¶
Returns the previous value, or ErrorNoSocket if the id was out of range
type Reactor ¶
type Reactor struct {
// contains filtered or unexported fields
}
func NewReactor ¶
func NewReactor() *Reactor
Create a reactor to mix the handling of sockets and channels (timers or other channels).
Example:
reactor := zmq.NewReactor() reactor.AddSocket(socket1, zmq.POLLIN, socket1_handler) reactor.AddSocket(socket2, zmq.POLLIN, socket2_handler) reactor.AddChannelTime(time.Tick(time.Second), 1, ticker_handler) reactor.Run(time.Second)
func (*Reactor) AddChannel ¶
func (r *Reactor) AddChannel(ch <-chan interface{}, limit int, handler func(interface{}) error) (id uint64)
Add channel handler to the reactor.
Returns id of added handler, that can be used later to remove it.
If limit is positive, at most this many items will be handled in each run through the main loop, otherwise it will process as many items as possible.
The handler function receives the value received from the channel.
func (*Reactor) AddChannelTime ¶
func (r *Reactor) AddChannelTime(ch <-chan time.Time, limit int, handler func(interface{}) error) (id uint64)
This function wraps AddChannel, using a channel of type time.Time instead of type interface{}.
func (*Reactor) AddSocket ¶
Add socket handler to the reactor.
You can have only one handler per socket. Adding a second one will remove the first.
The handler receives the socket state as an argument: POLLIN, POLLOUT, or both.
func (*Reactor) RemoveChannel ¶
Remove a channel from the reactor.
Closed channels are removed automatically.
func (*Reactor) RemoveSocket ¶
Remove a socket handler from the reactor.
func (*Reactor) Run ¶
Run the reactor.
The interval determines the time-out on the polling of sockets. Interval must be positive if there are channels. If there are no channels, you can set interval to -1.
The run alternates between polling/handling sockets (using the interval as timeout), and reading/handling channels. The reading of channels is without time-out: if there is no activity on any channel, the run continues to poll sockets immediately.
The run exits when any handler returns an error, returning that same error.
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
Socket functions starting with `Set` or `Get` are used for setting and getting socket options.
func NewSocket ¶
Create 0MQ socket in the default context.
WARNING: The Socket is not thread safe. This means that you cannot access the same Socket from different goroutines without using something like a mutex.
For a description of socket types, see: http://api.zeromq.org/3-2:zmq-socket#toc3
func (*Socket) Bind ¶
Accept incoming connections on a socket.
For a description of endpoint, see: http://api.zeromq.org/3-2:zmq-bind#toc2
func (*Socket) Close ¶
If not called explicitly, the socket will be closed on garbage collection
func (*Socket) Connect ¶
Create outgoing connection from socket.
For a description of endpoint, see: http://api.zeromq.org/3-2:zmq-connect#toc2
func (*Socket) Context ¶
Return the context associated with a socket
func (*Socket) Disconnect ¶
Disconnect a socket.
For a description of endpoint, see: http://api.zeromq.org/3-2:zmq-disconnect#toc2
func (*Socket) GetAffinity ¶
ZMQ_AFFINITY: Retrieve I/O thread affinity
func (*Socket) GetBacklog ¶
ZMQ_BACKLOG: Retrieve maximum length of the queue of outstanding connections
func (*Socket) GetDelayAttachOnConnect ¶
ZMQ_DELAY_ATTACH_ON_CONNECT: Retrieve attach-on-connect value
func (*Socket) GetEvents ¶
ZMQ_EVENTS: Retrieve socket event state
func (*Socket) GetFd ¶
ZMQ_FD: Retrieve file descriptor associated with the socket
func (*Socket) GetIdentity ¶
ZMQ_IDENTITY: Get socket identity
func (*Socket) GetIpv4only ¶
ZMQ_IPV4ONLY: Retrieve IPv4-only socket override status
func (*Socket) GetLastEndpoint ¶
ZMQ_LAST_ENDPOINT: Retrieve the last endpoint set
func (*Socket) GetLinger ¶
ZMQ_LINGER: Retrieve linger period for socket shutdown
Returns time.Duration(-1) for infinite ¶
func (*Socket) GetMaxmsgsize ¶
ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size
func (*Socket) GetMulticastHops ¶
ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets
func (*Socket) GetRate ¶
ZMQ_RATE: Retrieve multicast data rate
func (*Socket) GetRcvbuf ¶
ZMQ_RCVBUF: Retrieve kernel receive buffer size
func (*Socket) GetRcvhwm ¶
ZMQ_RCVHWM: Retrieve high water mark for inbound messages
func (*Socket) GetRcvmore ¶
ZMQ_RCVMORE: More message data parts to follow
func (*Socket) GetRcvtimeo ¶
ZMQ_RCVTIMEO: Maximum time before a socket operation returns with EAGAIN
Returns time.Duration(-1) for infinite ¶
func (*Socket) GetReconnectIvl ¶
ZMQ_RECONNECT_IVL: Retrieve reconnection interval
Returns time.Duration(-1) for no reconnection ¶
func (*Socket) GetReconnectIvlMax ¶
ZMQ_RECONNECT_IVL_MAX: Retrieve maximum reconnection interval
func (*Socket) GetRecoveryIvl ¶
ZMQ_RECOVERY_IVL: Get multicast recovery interval
func (*Socket) GetSndbuf ¶
ZMQ_SNDBUF: Retrieve kernel transmit buffer size
func (*Socket) GetSndhwm ¶
ZMQ_SNDHWM: Retrieves high water mark for outbound messages
func (*Socket) GetSndtimeo ¶
ZMQ_SNDTIMEO: Maximum time before a socket operation returns with EAGAIN
Returns time.Duration(-1) for infinite ¶
func (*Socket) GetTcpKeepalive ¶
ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option
func (*Socket) GetTcpKeepaliveCnt ¶
ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option
func (*Socket) GetTcpKeepaliveIdle ¶
ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)
func (*Socket) GetTcpKeepaliveIntvl ¶
ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option
func (*Socket) GetType ¶
ZMQ_TYPE: Retrieve socket type
func (*Socket) Monitor ¶
Register a monitoring callback.
See: http://api.zeromq.org/3-2:zmq-socket-monitor#toc2
WARNING: Closing a context with a monitoring callback will lead to random crashes. This is a bug in the ZeroMQ library. The monitoring callback has the same context as the socket it was created for.
Example:
package main import ( zmq "github.com/pebbe/zmq3" "log" "time" ) func rep_socket_monitor(addr string) { s, err := zmq.NewSocket(zmq.PAIR) if err != nil { log.Fatalln(err) } err = s.Connect(addr) if err != nil { log.Fatalln(err) } for { a, b, c, err := s.RecvEvent(0) if err != nil { log.Println(err) break } log.Println(a, b, c) } s.Close() } func main() { // REP socket rep, err := zmq.NewSocket(zmq.REP) if err != nil { log.Fatalln(err) } // REP socket monitor, all events err = rep.Monitor("inproc://monitor.rep", zmq.EVENT_ALL) if err != nil { log.Fatalln(err) } go rep_socket_monitor("inproc://monitor.rep") // Generate an event rep.Bind("tcp://*:5555") if err != nil { log.Fatalln(err) } // Allow some time for event detection time.Sleep(time.Second) rep.Close() zmq.Term() }
func (*Socket) Recv ¶
Receive a message part from a socket.
For a description of flags, see: http://api.zeromq.org/3-2:zmq-msg-recv#toc2
func (*Socket) RecvBytes ¶
Receive a message part from a socket.
For a description of flags, see: http://api.zeromq.org/3-2:zmq-msg-recv#toc2
func (*Socket) RecvEvent ¶
Receive a message part from a socket interpreted as an event.
For a description of flags, see: http://api.zeromq.org/3-2:zmq-msg-recv#toc2
For a description of event_type, see: http://api.zeromq.org/3-2:zmq-socket-monitor#toc2
For an example, see: func (*Socket) Monitor
func (*Socket) RecvMessageBytes ¶
Receive parts as message from socket.
Returns last non-nil error code.
func (*Socket) Send ¶
Send a message part on a socket.
For a description of flags, see: http://api.zeromq.org/3-2:zmq-send#toc2
func (*Socket) SendBytes ¶
Send a message part on a socket.
For a description of flags, see: http://api.zeromq.org/3-2:zmq-send#toc2
func (*Socket) SendMessage ¶
Send multi-part message on socket.
Any `[]string' or `[][]byte' is split into separate `string's or `[]byte's
Any other part that isn't a `string' or `[]byte' is converted to `string' with `fmt.Sprintf("%v", part)'.
Returns total bytes sent.
func (*Socket) SendMessageDontwait ¶
Like SendMessage(), but adding the DONTWAIT flag.
func (*Socket) SetAffinity ¶
ZMQ_AFFINITY: Set I/O thread affinity
func (*Socket) SetBacklog ¶
ZMQ_BACKLOG: Set maximum length of the queue of outstanding connections
func (*Socket) SetDelayAttachOnConnect ¶
ZMQ_DELAY_ATTACH_ON_CONNECT: Accept messages only when connections are made
func (*Socket) SetIdentity ¶
ZMQ_IDENTITY: Set socket identity
func (*Socket) SetIpv4only ¶
ZMQ_IPV4ONLY: Use IPv4-only sockets
func (*Socket) SetMaxmsgsize ¶
ZMQ_MAXMSGSIZE: Maximum acceptable inbound message size
func (*Socket) SetMulticastHops ¶
ZMQ_MULTICAST_HOPS: Maximum network hops for multicast packets
func (*Socket) SetRate ¶
ZMQ_RATE: Set multicast data rate
func (*Socket) SetRcvbuf ¶
ZMQ_RCVBUF: Set kernel receive buffer size
func (*Socket) SetRcvhwm ¶
ZMQ_RCVHWM: Set high water mark for inbound messages
func (*Socket) SetRcvtimeo ¶
ZMQ_RCVTIMEO: Maximum time before a recv operation returns with EAGAIN
Use -1 for infinite ¶
func (*Socket) SetReconnectIvl ¶
ZMQ_RECONNECT_IVL: Set reconnection interval
Use -1 for no reconnection ¶
func (*Socket) SetReconnectIvlMax ¶
ZMQ_RECONNECT_IVL_MAX: Set maximum reconnection interval
func (*Socket) SetRecoveryIvl ¶
ZMQ_RECOVERY_IVL: Set multicast recovery interval
func (*Socket) SetRouterMandatory ¶
ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets
func (*Socket) SetSndbuf ¶
ZMQ_SNDBUF: Set kernel transmit buffer size
func (*Socket) SetSndhwm ¶
ZMQ_SNDHWM: Set high water mark for outbound messages
func (*Socket) SetSndtimeo ¶
ZMQ_SNDTIMEO: Maximum time before a send operation returns with EAGAIN
Use -1 for infinite ¶
func (*Socket) SetSubscribe ¶
ZMQ_SUBSCRIBE: Establish message filter
func (*Socket) SetTcpAcceptFilter ¶
ZMQ_TCP_ACCEPT_FILTER: Assign filters to allow new TCP connections
func (*Socket) SetTcpKeepalive ¶
ZMQ_TCP_KEEPALIVE: Override SO_KEEPALIVE socket option
func (*Socket) SetTcpKeepaliveCnt ¶
ZMQ_TCP_KEEPALIVE_CNT: Override TCP_KEEPCNT socket option
func (*Socket) SetTcpKeepaliveIdle ¶
ZMQ_TCP_KEEPALIVE_IDLE: Override TCP_KEEPCNT(or TCP_KEEPALIVE on some OS)
func (*Socket) SetTcpKeepaliveIntvl ¶
ZMQ_TCP_KEEPALIVE_INTVL: Override TCP_KEEPINTVL socket option
func (*Socket) SetUnsubscribe ¶
ZMQ_UNSUBSCRIBE: Remove message filter
func (*Socket) SetXpubVerbose ¶
ZMQ_XPUB_VERBOSE: provide all subscription messages on XPUB sockets
func (*Socket) Unbind ¶
Stop accepting connections on a socket.
For a description of endpoint, see: http://api.zeromq.org/3-2:zmq-bind#toc2
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
bstar
bstar - Binary Star reactor.
|
bstar - Binary Star reactor. |
clone
Clone client API stack (multithreaded).
|
Clone client API stack (multithreaded). |
flcliapi
flcliapi - Freelance Pattern agent class.
|
flcliapi - Freelance Pattern agent class. |
intface
Interface class for Chapter 8.
|
Interface class for Chapter 8. |
kvmsg
kvmsg class - key-value message class for example applications
|
kvmsg class - key-value message class for example applications |
kvsimple
kvsimple - simple key-value message class for example applications.
|
kvsimple - simple key-value message class for example applications. |
mdapi
Majordomo Protocol Client and Worker API.
|
Majordomo Protocol Client and Worker API. |