-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Socket utilities. -- -- Binary ingress server, egress client, and bidirectional binarry -- client/server @package om-socket @version 0.11.0.3 -- | Socket utilities. module OM.Socket -- | A description of a socket address on which a socket is or should be -- listening. Supports both IPv4 and IPv6. -- -- Examples: -- --
--   AddressDescription "[::1]:80" -- IPv6 localhost, port 80
--   AddressDescription "127.0.0.1:80" -- IPv4 localhost, port 80
--   AddressDescription "somehost:80" -- IPv4 or IPv6 (depending on what name resolution returns), port 80
--   
newtype AddressDescription AddressDescription :: Text -> AddressDescription [unAddressDescription] :: AddressDescription -> Text -- | Resolve a host:port address into a SockAddr. resolveAddr :: (MonadIO m, MonadFail m) => AddressDescription -> m SockAddr -- | Opens an "ingress" socket, which is a socket that accepts a stream of -- messages without responding. openIngress :: (Binary i, MonadIO m, MonadFail m) => AddressDescription -> ConduitT () i m () -- | Open an "egress" socket, which is a socket that sends a stream of -- messages without receiving responses. openEgress :: (Binary o, MonadFail m, MonadIO m, MonadThrow m) => AddressDescription -> ConduitT o Void m () -- | Open a "server" socket, which is a socket that accepts incoming -- requests and provides a way to respond to those requests. openServer :: (Binary request, Binary response, MonadFail m, MonadLoggerIO m, Show request, Show response) => AddressDescription -> Maybe (IO ServerParams) -> ConduitT Void (request, response -> m Responded) m () -- | Proof that a response function was called on the server. Mainly useful -- for including in a type signature somewhere in your server -- implementation to help ensure that you actually responded to the -- request in all cases. data Responded -- | Connect to a server. Returns a function in MonadIO that can be -- used to submit requests to (and returns the corresponding response -- from) the server. connectServer :: (Binary request, Binary response, MonadIO m, MonadLoggerIO n, Show response) => AddressDescription -> Maybe ClientParams -> n (request -> m response) instance Data.Aeson.Types.ToJSON.ToJSONKey OM.Socket.AddressDescription instance Data.Aeson.Types.ToJSON.ToJSON OM.Socket.AddressDescription instance GHC.Base.Semigroup OM.Socket.AddressDescription instance GHC.Classes.Ord OM.Socket.AddressDescription instance GHC.Base.Monoid OM.Socket.AddressDescription instance Data.String.IsString OM.Socket.AddressDescription instance Data.Aeson.Types.FromJSON.FromJSONKey OM.Socket.AddressDescription instance Data.Aeson.Types.FromJSON.FromJSON OM.Socket.AddressDescription instance GHC.Classes.Eq OM.Socket.AddressDescription instance Data.Binary.Class.Binary OM.Socket.AddressDescription instance GHC.Generics.Generic OM.Socket.AddressDescription instance GHC.Generics.Generic OM.Socket.Endpoint instance GHC.Enum.Enum OM.Socket.MessageId instance GHC.Show.Show OM.Socket.MessageId instance GHC.Classes.Ord OM.Socket.MessageId instance GHC.Classes.Eq OM.Socket.MessageId instance GHC.Enum.Bounded OM.Socket.MessageId instance GHC.Num.Num OM.Socket.MessageId instance Data.Binary.Class.Binary OM.Socket.MessageId instance GHC.Show.Show p => GHC.Show.Show (OM.Socket.Request p) instance GHC.Generics.Generic (OM.Socket.Request p) instance GHC.Show.Show p => GHC.Show.Show (OM.Socket.Response p) instance GHC.Generics.Generic (OM.Socket.Response p) instance Data.Binary.Class.Binary p => Data.Binary.Class.Binary (OM.Socket.Response p) instance Data.Binary.Class.Binary p => Data.Binary.Class.Binary (OM.Socket.Request p) instance GHC.Show.Show OM.Socket.AddressDescription