ipbl/vendor/gopkg.in/zeromq/goczmq.v4/sock_draft.go
Paul Lecuq 90136fe906
Some checks failed
continuous-integration/drone/push Build is failing
added zeromq handling
2022-03-11 23:34:09 +01:00

31 lines
632 B
Go

// +build draft
package goczmq
/*
#include "czmq.h"
*/
import "C"
const (
// Scatter is a ZMQ_SCATTER socket type
Scatter = int(C.ZMQ_SCATTER)
// Gather is a ZMQ_GATHER socket type
Gather = int(C.ZMQ_GATHER)
)
// NewGather creates a Gather socket and calls Attach.
// The socket will Bind by default.
func NewGather(endpoints string) (*Sock, error) {
s := NewSock(Gather)
return s, s.Attach(endpoints, true)
}
// NewScatter creates a Scatter socket and calls Attach.
// The socket will Connect by default.
func NewScatter(endpoints string) (*Sock, error) {
s := NewSock(Scatter)
return s, s.Attach(endpoints, false)
}