| Portability | non-portable |
|---|---|
| Stability | experimental |
| Maintainer | toralf.wittner@gmail.com |
System.ZMQ
Description
- type Size = Word
- data Context
- data Socket a
- data Flag
- data SocketOption
- data Poll
- data PollEvent
- data P2P = P2P
- data Pub = Pub
- data Sub = Sub
- data Req = Req
- data Rep = Rep
- data XReq = Xreq
- data XRep = Xrep
- data Up = Up
- data Down = Down
- init :: Size -> Size -> Bool -> IO Context
- term :: Context -> IO ()
- socket :: SType a => Context -> a -> IO (Socket a)
- close :: Socket a -> IO ()
- setOption :: Socket a -> SocketOption -> IO ()
- subscribe :: SubsType a => Socket a -> String -> IO ()
- unsubscribe :: SubsType a => Socket a -> String -> IO ()
- bind :: Socket a -> String -> IO ()
- connect :: Socket a -> String -> IO ()
- send :: Socket a -> ByteString -> [Flag] -> IO ()
- flush :: Socket a -> IO ()
- receive :: Socket a -> [Flag] -> IO ByteString
- poll :: [Poll] -> Timeout -> IO [Poll]
Documentation
The events to wait for in poll (cf. man zmq_poll)
data SocketOption Source
Flags to apply on send operations (cf. man zmq_send)
Constructors
| HighWM Int64 | ZMQ_HWM |
| LowWM Int64 | ZMQ_LWM |
| Swap Int64 | ZMQ_SWAP |
| Affinity Int64 | ZMQ_AFFINITY |
| Identity String | ZMQ_IDENTITY |
| Rate Word64 | ZMQ_RATE |
| RecoveryIVL Word64 | ZMQ_RECOVERY_IVL |
| McastLoop Word64 | ZMQ_MCAST_LOOP |
| SendBuf Word64 | ZMQ_SNDBUF |
| ReceiveBuf Word64 | ZMQ_RCVBUF |
Instances
Initialize a 0MQ context (cf. zmq_init).
Type representing a descriptor, poll is waiting for (either a 0MQ socket or a file descriptor) plus the type of event of wait for.
Constructors
| Sub |
close :: Socket a -> IO ()Source
Set the given option on the socket. Please note that there are certain combatibility constraints w.r.t the socket type (cf. man zmq_setsockopt).
Please note that subscribe/unsubscribe is handled with separate functions.
subscribe :: SubsType a => Socket a -> String -> IO ()Source
Unsubscribe Socket from given subscription.
unsubscribe :: SubsType a => Socket a -> String -> IO ()Source
Bind the socket to the given address (zmq_bind)