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
  - zmqSocketType :: a -> ZMQSocketType
- class SocketLike (s :: Type -> Type) where
  - toSocket :: s t -> Socket t
- 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 Source #

A 0MQ context representation.

Constructors

Context |

Fields

- _ctx :: ZMQCtx

newtype Socket a Source #

A 0MQ Socket.

Constructors

Socket |

Fields

- _socketRepr :: SocketRepr

#### Instances

Instances details

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

data SocketRepr Source #

Constructors

SocketRepr |

Fields

- _socket :: ZMQSocket
- _sockLive :: IORef Bool

class SocketType a where Source #

Socket types.

Methods

zmqSocketType :: a -> ZMQSocketType Source #

#### Instances

Instances details

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

class SocketLike (s :: Type -> Type) where Source #

Methods

toSocket :: s t -> Socket t Source #

#### Instances

Instances details

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

newtype Message Source #

Constructors

Message |

Fields

- msgPtr :: ZMQMsgPtr

data Flag Source #

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

Constructors

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

#### Instances

Instances details

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

type Timeout = Int64 Source #

type Size = Word Source #

data Switch Source #

Configuration switch

Constructors

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

#### Instances

Instances details

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

data EventType Source #

Event types to monitor.

Constructors

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

#### Instances

Instances details

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

Instance details

Defined in System.ZMQ4.Internal

Methods

compare :: EventType -> EventType -> Ordering Source #

(<) :: EventType -> EventType -> Bool Source #

(<=) :: EventType -> EventType -> Bool Source #

(>) :: EventType -> EventType -> Bool Source #

(>=) :: EventType -> EventType -> Bool Source #

max :: EventType -> EventType -> EventType Source #

min :: EventType -> EventType -> EventType Source #

data EventMsg Source #

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

Instances details

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

data SecurityMechanism Source #

Constructors

Null |
Plain |
Curve |

#### Instances

Instances details

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

data KeyFormat a where Source #

Constructors

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

#### Instances

Instances details

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

messageOf :: ByteString -> IO Message Source #

messageOfLazy :: ByteString -> IO Message Source #

messageClose :: Message -> IO () Source #

messageFree :: Message -> IO () Source #

messageInit :: IO Message Source #

messageInitSize :: Size -> IO Message Source #

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

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

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

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

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

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

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

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

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

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

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

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

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

toZMQFlag :: Flag -> ZMQFlag Source #

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

combineFlags :: [Flag] -> CInt Source #

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

closeSock :: SocketRepr -> IO () Source #

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

bool2cint :: Bool -> CInt Source #

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

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

events2cint :: [EventType] -> CInt Source #

eventMessage :: ByteString -> ZMQEvent -> EventMsg Source #

toMechanism :: SecurityMechanism -> ZMQSecMechanism Source #

fromMechanism :: String -> Int -> SecurityMechanism Source #

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