The xml-push package

[ Tags: bsd3, library, network ] [ Propose Tags ]

examples/TestSimple.hs

extensions

module TestSimple (testSimple) where

import Control.Monad
import Control.Concurrent
import Data.Maybe
import Data.Pipe
import Data.Pipe.ByteString
import System.IO
import Text.XML.Pipe
import Network.XmlPush
import Network.XmlPush.Simple

testSimple :: Handle -> IO ()
testSimple h = do
	(sp :: SimplePusher Handle) <- generate (One h) ()
	void . forkIO . runPipe_ $ readFrom sp
		=$= convert (xmlString . (: []))
		=$= toHandle stdout
	runPipe_ $ fromHandle stdin
		=$= xmlEvent
		=$= convert fromJust
		=$= xmlNode []
		=$= writeTo sp

examples/simpleClient

import Network
import TestSimple

main :: IO ()
main = testSimple =<< connectTo "localhost" (PortNumber 54492)

examples/simpleServer

import Control.Monad
import Control.Concurrent
import Network

import TestSimple

main :: IO ()
main = forever . (void . forkIO . testSimple . fst3 =<<) . accept
	=<< listenOn (PortNumber 54492)

fst3 :: (a, b, c) -> a
fst3 (x, _, _) = x

Properties

Versions 0.0.0.0, 0.0.0.1, 0.0.0.2, 0.0.0.3, 0.0.0.4, 0.0.0.5, 0.0.0.6, 0.0.0.7, 0.0.0.8, 0.0.0.9, 0.0.0.10, 0.0.0.11, 0.0.0.12, 0.0.0.13, 0.0.0.14, 0.0.0.15, 0.0.0.16, 0.0.0.17, 0.0.0.18
Dependencies base (==4.*), bytestring (==0.10.*), crypto-random (==0.0.*), handle-like (==0.1.*), monad-control (==0.3.*), monads-tf (==0.1.*), peyotls (==0.1.*), random (==1.0.*), sasl (==0.0.*), simple-pipe (==0.0.*), stm (==2.4.*), tighttp (==0.0.*), transformers-base (==0.4.*), uuid (==1.3.*), x509 (==1.4.*), x509-store (==1.4.*), x509-validation (==1.5.*), xml-pipe (==0.0.*), xmpipe (==0.0.*) [details]
License BSD3
Author Yoshikuni Jujo <PAF01143@nifty.ne.jp>
Maintainer Yoshikuni Jujo <PAF01143@nifty.ne.jp>
Category Network
Home page https://github.com/YoshikuniJujo/xml-push/wiki
Source repository head: git clone git://github.com/YoshikuniJujo/xml-push.git
this: git clone git://github.com/YoshikuniJujo/xml-push.git(tag xml-push-0.0.0.18)
Uploaded Sun Oct 5 22:20:18 UTC 2014 by YoshikuniJujo
Distributions NixOS:0.0.0.18
Downloads 3041 total (22 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees