zeromq4-haskell-0.8.0: Bindings to ZeroMQ 4.x

Safe Haskell | None
Language | Haskell98

System.ZMQ4.Internal

Description

Warning: This is an internal module and subject to change without notice.

Synopsis

- newtype Context = Context {
  - _ctx :: ZMQCtx
  }
- newtype Socket a = Socket {
  - _socketRepr :: SocketRepr
  }
- data SocketRepr = SocketRepr {
  - _socket :: ZMQSocket
  - _sockLive :: IORef Bool
  }
- class SocketType a where
- class SocketLike s where
- newtype Message = Message {
  - msgPtr :: ZMQMsgPtr
  }
- data Flag
  - = DontWait
  - | SendMore
- type Timeout = Int64
- type Size = Word
- data Switch
  - = Default
  - | On
  - | Off
- data EventType
  - = ConnectedEvent
  - | ConnectDelayedEvent
  - | ConnectRetriedEvent
  - | ListeningEvent
  - | BindFailedEvent
  - | AcceptedEvent
  - | AcceptFailedEvent
  - | ClosedEvent
  - | CloseFailedEvent
  - | DisconnectedEvent
  - | MonitorStoppedEvent
  - | AllEvents
- data EventMsg
  - = Connected !ByteString !Fd
  - | ConnectDelayed !ByteString
  - | ConnectRetried !ByteString !Int
  - | Listening !ByteString !Fd
  - | BindFailed !ByteString !Int
  - | Accepted !ByteString !Fd
  - | AcceptFailed !ByteString !Int
  - | Closed !ByteString !Fd
  - | CloseFailed !ByteString !Int
  - | Disconnected !ByteString !Fd
  - | MonitorStopped !ByteString !Int
- data SecurityMechanism
  - = Null
  - | Plain
  - | Curve
- data KeyFormat a where
  - BinaryFormat :: KeyFormat Div4
  - TextFormat :: KeyFormat Div5
- messageOf :: ByteString -> IO Message
- messageOfLazy :: ByteString -> IO Message
- messageClose :: Message -> IO ()
- messageFree :: Message -> IO ()
- messageInit :: IO Message
- messageInitSize :: Size -> IO Message
- setIntOpt :: (Storable b, Integral b) => Socket a -> ZMQOption -> b -> IO ()
- setStrOpt :: Socket a -> ZMQOption -> String -> IO ()
- getIntOpt :: (Storable b, Integral b) => Socket a -> ZMQOption -> b -> IO b
- getStrOpt :: Socket a -> ZMQOption -> IO String
- getInt32Option :: ZMQOption -> Socket a -> IO Int
- setInt32OptFromRestricted :: Integral i => ZMQOption -> Restricted r i -> Socket b -> IO ()
- ctxIntOption :: Integral i => String -> ZMQCtxOption -> Context -> IO i
- setCtxIntOption :: Integral i => String -> ZMQCtxOption -> i -> Context -> IO ()
- getBytesOpt :: Socket a -> ZMQOption -> IO ByteString
- getByteStringOpt :: Socket a -> ZMQOption -> IO ByteString
- setByteStringOpt :: Socket a -> ZMQOption -> ByteString -> IO ()
- z85Encode :: MonadIO m => Restricted Div4 ByteString -> m ByteString
- z85Decode :: MonadIO m => Restricted Div5 ByteString -> m ByteString
- toZMQFlag :: Flag -> ZMQFlag
- combine :: (Integral i, Bits i) => [i] -> i
- combineFlags :: [Flag] -> CInt
- mkSocketRepr :: SocketType t => t -> Context -> IO SocketRepr
- closeSock :: SocketRepr -> IO ()
- onSocket :: String -> Socket a -> (ZMQSocket -> IO b) -> IO b
- bool2cint :: Bool -> CInt
- toSwitch :: (Show a, Integral a) => String -> a -> Switch
- fromSwitch :: Integral a => Switch -> a
- events2cint :: [EventType] -> CInt
- eventMessage :: ByteString -> ZMQEvent -> EventMsg
- toMechanism :: SecurityMechanism -> ZMQSecMechanism
- fromMechanism :: String -> Int -> SecurityMechanism
- getKey :: KeyFormat f -> Socket a -> ZMQOption -> IO ByteString

# Documentation

newtype Context #

A 0MQ context representation.

Constructors

Context |
Fields _ctx :: ZMQCtx

newtype Socket a #

A 0MQ Socket.

Constructors

Socket |
Fields _socketRepr :: SocketRepr

Instances

SocketLike Socket # |
Instance details Defined in System.ZMQ4.Internal Methods toSocket :: Socket t -> Socket t #

data SocketRepr #

Constructors

SocketRepr |
Fields _socket :: ZMQSocket _sockLive :: IORef Bool

class SocketType a where #

Socket types.

Minimal complete definition

zmqSocketType

Methods

zmqSocketType :: a -> ZMQSocketType #

Instances

SocketType Stream # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Stream -> ZMQSocketType #
SocketType Push # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Push -> ZMQSocketType #
SocketType Pull # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Pull -> ZMQSocketType #
SocketType Router # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Router -> ZMQSocketType #
SocketType Dealer # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Dealer -> ZMQSocketType #
SocketType Rep # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Rep -> ZMQSocketType #
SocketType Req # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Req -> ZMQSocketType #
SocketType XSub # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: XSub -> ZMQSocketType #
SocketType XPub # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: XPub -> ZMQSocketType #
SocketType Sub # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Sub -> ZMQSocketType #
SocketType Pub # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Pub -> ZMQSocketType #
SocketType Pair # |
Instance details Defined in System.ZMQ4 Methods zmqSocketType :: Pair -> ZMQSocketType #

class SocketLike s where #

Minimal complete definition

toSocket

Methods

toSocket :: s t -> Socket t #

Instances

SocketLike Socket # |
Instance details Defined in System.ZMQ4.Internal Methods toSocket :: Socket t -> Socket t #
SocketLike (Socket z) # |
Instance details Defined in System.ZMQ4.Monadic Methods toSocket :: Socket z t -> Socket0 t #

newtype Message #

Constructors

Message |
Fields msgPtr :: ZMQMsgPtr

data Flag #

Flags to apply on send operations (cf. man zmq_send)

Constructors

DontWait | ZMQ_DONTWAIT (Only relevant on Windows.)
SendMore | ZMQ_SNDMORE

Instances

Eq Flag # |
Instance details Defined in System.ZMQ4.Internal Methods (==) :: Flag -> Flag -> Bool # (/=) :: Flag -> Flag -> Bool #
Ord Flag # |
Instance details Defined in System.ZMQ4.Internal Methods compare :: Flag -> Flag -> Ordering # (<) :: Flag -> Flag -> Bool # (<=) :: Flag -> Flag -> Bool # (>) :: Flag -> Flag -> Bool # (>=) :: Flag -> Flag -> Bool # max :: Flag -> Flag -> Flag # min :: Flag -> Flag -> Flag #
Show Flag # |
Instance details Defined in System.ZMQ4.Internal Methods showsPrec :: Int -> Flag -> ShowS # show :: Flag -> String # showList :: [Flag] -> ShowS #

type Timeout = Int64 #

type Size = Word #

data Switch #

Configuration switch

Constructors

Default | Use default setting
On | Activate setting
Off | De-activate setting

Instances

Eq Switch # |
Instance details Defined in System.ZMQ4.Internal Methods (==) :: Switch -> Switch -> Bool # (/=) :: Switch -> Switch -> Bool #
Ord Switch # |
Instance details Defined in System.ZMQ4.Internal Methods compare :: Switch -> Switch -> Ordering # (<) :: Switch -> Switch -> Bool # (<=) :: Switch -> Switch -> Bool # (>) :: Switch -> Switch -> Bool # (>=) :: Switch -> Switch -> Bool # max :: Switch -> Switch -> Switch # min :: Switch -> Switch -> Switch #
Show Switch # |
Instance details Defined in System.ZMQ4.Internal Methods showsPrec :: Int -> Switch -> ShowS # show :: Switch -> String # showList :: [Switch] -> ShowS #

data EventType #

Event types to monitor.

Constructors

ConnectedEvent |
ConnectDelayedEvent |
ConnectRetriedEvent |
ListeningEvent |
BindFailedEvent |
AcceptedEvent |
AcceptFailedEvent |
ClosedEvent |
CloseFailedEvent |
DisconnectedEvent |
MonitorStoppedEvent |
AllEvents |

Instances

Eq EventType # |
Instance details Defined in System.ZMQ4.Internal Methods (==) :: EventType -> EventType -> Bool # (/=) :: EventType -> EventType -> Bool #
Ord EventType # |
Instance details Defined in System.ZMQ4.Internal Methods compare :: EventType -> EventType -> Ordering # (<) :: EventType -> EventType -> Bool # (<=) :: EventType -> EventType -> Bool # (>) :: EventType -> EventType -> Bool # (>=) :: EventType -> EventType -> Bool # max :: EventType -> EventType -> EventType # min :: EventType -> EventType -> EventType #
Show EventType # |
Instance details Defined in System.ZMQ4.Internal Methods showsPrec :: Int -> EventType -> ShowS # show :: EventType -> String # showList :: [EventType] -> ShowS #

data EventMsg #

Event Message to receive when monitoring socket events.

Constructors

Connected !ByteString !Fd |
ConnectDelayed !ByteString |
ConnectRetried !ByteString !Int |
Listening !ByteString !Fd |
BindFailed !ByteString !Int |
Accepted !ByteString !Fd |
AcceptFailed !ByteString !Int |
Closed !ByteString !Fd |
CloseFailed !ByteString !Int |
Disconnected !ByteString !Fd |
MonitorStopped !ByteString !Int |

Instances

Eq EventMsg # |
Instance details Defined in System.ZMQ4.Internal Methods (==) :: EventMsg -> EventMsg -> Bool # (/=) :: EventMsg -> EventMsg -> Bool #
Show EventMsg # |
Instance details Defined in System.ZMQ4.Internal Methods showsPrec :: Int -> EventMsg -> ShowS # show :: EventMsg -> String # showList :: [EventMsg] -> ShowS #

data SecurityMechanism #

Constructors

Null |
Plain |
Curve |

Instances

Eq SecurityMechanism # |
Instance details Defined in System.ZMQ4.Internal Methods (==) :: SecurityMechanism -> SecurityMechanism -> Bool # (/=) :: SecurityMechanism -> SecurityMechanism -> Bool #
Show SecurityMechanism # |
Instance details Defined in System.ZMQ4.Internal Methods showsPrec :: Int -> SecurityMechanism -> ShowS # show :: SecurityMechanism -> String # showList :: [SecurityMechanism] -> ShowS #

data KeyFormat a where #

Constructors

BinaryFormat :: KeyFormat Div4 |
TextFormat :: KeyFormat Div5 |

Instances

Eq (KeyFormat a) # |
Instance details Defined in System.ZMQ4.Internal Methods (==) :: KeyFormat a -> KeyFormat a -> Bool # (/=) :: KeyFormat a -> KeyFormat a -> Bool #
Show (KeyFormat a) # |
Instance details Defined in System.ZMQ4.Internal Methods showsPrec :: Int -> KeyFormat a -> ShowS # show :: KeyFormat a -> String # showList :: [KeyFormat a] -> ShowS #

messageOf :: ByteString -> IO Message #

messageOfLazy :: ByteString -> IO Message #

messageClose :: Message -> IO () #

messageFree :: Message -> IO () #

messageInit :: IO Message #

messageInitSize :: Size -> IO Message #

setIntOpt :: (Storable b, Integral b) => Socket a -> ZMQOption -> b -> IO () #

setStrOpt :: Socket a -> ZMQOption -> String -> IO () #

getIntOpt :: (Storable b, Integral b) => Socket a -> ZMQOption -> b -> IO b #

getStrOpt :: Socket a -> ZMQOption -> IO String #

getInt32Option :: ZMQOption -> Socket a -> IO Int #

setInt32OptFromRestricted :: Integral i => ZMQOption -> Restricted r i -> Socket b -> IO () #

ctxIntOption :: Integral i => String -> ZMQCtxOption -> Context -> IO i #

setCtxIntOption :: Integral i => String -> ZMQCtxOption -> i -> Context -> IO () #

getBytesOpt :: Socket a -> ZMQOption -> IO ByteString #

getByteStringOpt :: Socket a -> ZMQOption -> IO ByteString #

setByteStringOpt :: Socket a -> ZMQOption -> ByteString -> IO () #

z85Encode :: MonadIO m => Restricted Div4 ByteString -> m ByteString #

z85Decode :: MonadIO m => Restricted Div5 ByteString -> m ByteString #

toZMQFlag :: Flag -> ZMQFlag #

combine :: (Integral i, Bits i) => [i] -> i #

combineFlags :: [Flag] -> CInt #

mkSocketRepr :: SocketType t => t -> Context -> IO SocketRepr #

closeSock :: SocketRepr -> IO () #

onSocket :: String -> Socket a -> (ZMQSocket -> IO b) -> IO b #

bool2cint :: Bool -> CInt #

toSwitch :: (Show a, Integral a) => String -> a -> Switch #

fromSwitch :: Integral a => Switch -> a #

events2cint :: [EventType] -> CInt #

eventMessage :: ByteString -> ZMQEvent -> EventMsg #

toMechanism :: SecurityMechanism -> ZMQSecMechanism #

fromMechanism :: String -> Int -> SecurityMechanism #

getKey :: KeyFormat f -> Socket a -> ZMQOption -> IO ByteString #