xml-push: Push XML from/to client to/from server over XMPP or HTTP

[ bsd3, library, network ] [ Propose Tags ] [ Report a vulnerability ]

examples/TestSimple.hs

extensions

  • ScopedTypeVariables

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

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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 && <5), bytestring (>=0.10 && <0.11), crypto-random (>=0.0 && <0.1), handle-like (>=0.1 && <0.2), monad-control (>=0.3 && <0.4), monads-tf (>=0.1 && <0.2), peyotls (>=0.1 && <0.2), random (>=1.0 && <1.1), sasl (>=0.0 && <0.1), simple-pipe (>=0.0 && <0.1), stm (>=2.4 && <2.5), tighttp (>=0.0 && <0.1), transformers-base (>=0.4 && <0.5), uuid (>=1.3 && <1.4), x509 (>=1.4 && <1.5), x509-store (>=1.4 && <1.5), x509-validation (>=1.5 && <1.6), xml-pipe (>=0.0 && <0.1), xmpipe (>=0.0 && <0.1) [details]
License BSD-3-Clause
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 repo 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 by YoshikuniJujo at 2014-10-05T22:20:18Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 11723 total (0 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]