Pup-Events-Client 1.1.3 → 1.1.4
raw patch · 2 files changed
+5/−4 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- PupEventsClient: client :: Maybe [Char] -> Int -> (a -> Int) -> (t -> t -> String) -> [ParsecT [Char] () Identity a] -> IO (PQueue t, PQueue a, IO ())
+ PupEventsClient: client :: Maybe [Char] -> Int -> String -> (a -> Int) -> (t -> t -> String) -> [ParsecT [Char] () Identity a] -> IO (PQueue t, PQueue a, IO ())
Files
- Pup-Events-Client.cabal +1/−1
- PupEventsClient.hs +4/−3
Pup-Events-Client.cabal view
@@ -1,5 +1,5 @@ name: Pup-Events-Client-version: 1.1.3+version: 1.1.4 synopsis: A networked event handling framework for hooking into other programs. description: Pup-Events is a networking enabled event handling
PupEventsClient.hs view
@@ -20,14 +20,15 @@ -- |The client function is the main entry point for the client code. It creates a socket, spawns two processes ('sendEvents' and 'recvEvents') to handle outgoing and incoming events, and returns the queues used to communicate with those processes. client :: Maybe [Char] -- ^ The address to connect to. If ommitted we connect to 'localhost' -> Int -- ^ The number of priorities in the PQueue+ -> String -- ^ The port to start the client on. -> (a -> Int) -- ^ A function to return the priority level of an event -> (t -> t -> String) -- ^ A function to return the string representation of an event -> [ParsecT [Char] () Data.Functor.Identity.Identity a] -- ^ A list of parsers that return Event objects -> IO (PQueue t, PQueue a, IO ()) -- ^ We return a pair of "PQueues" to use in communicating events. The first is for all events going to the server, the second is for events coming from the server. We also return a function to manually close both the socket and handle we use to connect to the server.-client Nothing priorities lookupPriority lookupUnHandler parsers = client (Just "localhost") priorities lookupPriority lookupUnHandler parsers-client ip priorities lookupPriority lookupUnHandler parsers=+client Nothing priorities port lookupPriority lookupUnHandler parsers = client (Just "localhost") priorities port lookupPriority lookupUnHandler parsers+client ip priorities port lookupPriority lookupUnHandler parsers= -- get address info- do addrinfos <- getAddrInfo Nothing ip (Just "1267")+ do addrinfos <- getAddrInfo Nothing ip (Just port) let serveraddr = head addrinfos -- create socket sock <- socket (addrFamily serveraddr) Stream 6