Socket
Socket
Sign inDemoInstall

github.com/pebbe/zmq4

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/pebbe/zmq4

A Go interface to ZeroMQ (zmq, 0mq) version 4. For ZeroMQ version 3, see: http://github.com/pebbe/zmq3 For ZeroMQ version 2, see: http://github.com/pebbe/zmq2 http://www.zeromq.org/ See also the wiki: 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. ---- Since Go 1.14 you will get a lot of interrupted system calls. See: https://golang.org/doc/go1.14#runtime There are two options to prevent this. The first option is to build your program with the environment variable: The second option is to let the program retry after an interrupted system call. Initially, this is set to true, for the global context, and for contexts created with NewContext(). When you install a signal handler, for instance to handle Ctrl-C, you should probably clear this option in your signal handler. For example: ----


Version published

Readme

Source

A Go interface to ZeroMQ version 4.


Warning

Starting with Go 1.14, on Unix-like systems, you will get a lot of interrupted signal calls. See the top of a package documentation for a fix.


Go Report Card GoDoc

This requires ZeroMQ version 4.0.1 or above. To use CURVE security in versions prior to 4.2, ZeroMQ must be installed with libsodium enabled.

Partial support for ZeroMQ 4.2 DRAFT is available in the alternate version of zmq4 draft. The API pertaining to this is subject to change. To use this:

import (
    zmq "github.com/pebbe/zmq4/draft"
)

For ZeroMQ version 3, see: http://github.com/pebbe/zmq3

For ZeroMQ version 2, see: http://github.com/pebbe/zmq2

Including all examples of ØMQ - The Guide.

Keywords: zmq, zeromq, 0mq, networks, distributed computing, message passing, fanout, pubsub, pipeline, request-reply

See also

  • go-zeromq/zmq4 — A pure-Go implementation of ØMQ (ZeroMQ), version 4
  • go-nanomsg — Language bindings for nanomsg in Go
  • goczmq — A Go interface to CZMQ
  • Mangos — An implementation in pure Go of the SP ("Scalable Protocols") protocols

Requirements

zmq4 is just a wrapper for the ZeroMQ library. It doesn't include the library itself. So you need to have ZeroMQ installed, including its development files. On Linux and Darwin you can check this with ($ is the command prompt):

$ pkg-config --modversion libzmq
4.3.1

The Go compiler must be able to compile C code. You can check this with:

$ go env CGO_ENABLED
1

You can't do cross-compilation. That would disable C.

Windows

Build with CGO_CFLAGS and CGO_LDFLAGS environment variables, for example:

$env:CGO_CFLAGS='-ID:/dev/vcpkg/installed/x64-windows/include'
$env:CGO_LDFLAGS='-LD:/dev/vcpkg/installed/x64-windows/lib -l:libzmq-mt-4_3_4.lib'

Deploy result program with libzmq-mt-4_3_4.dll

Install

go get github.com/pebbe/zmq4

Docs

API change

There has been an API change in commit 0bc5ab465849847b0556295d9a2023295c4d169e of 2014-06-27, 10:17:55 UTC in the functions AuthAllow and AuthDeny.

Old:

func AuthAllow(addresses ...string)
func AuthDeny(addresses ...string)

New:

func AuthAllow(domain string, addresses ...string)
func AuthDeny(domain string, addresses ...string)

If domain can be parsed as an IP address, it will be interpreted as such, and it and all remaining addresses are added to all domains.

So this should still work as before:

zmq.AuthAllow("127.0.0.1", "123.123.123.123")

But this won't compile:

a := []string{"127.0.0.1", "123.123.123.123"}
zmq.AuthAllow(a...)

And needs to be rewritten as:

a := []string{"127.0.0.1", "123.123.123.123"}
zmq.AuthAllow("*", a...)

Furthermore, an address can now be a single IP address, as well as an IP address and mask in CIDR notation, e.g. "123.123.123.0/24".

FAQs

Last updated on 12 Jun 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc