Skip to content

Instantly share code, notes, and snippets.

@keizo042
Created August 10, 2017 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keizo042/5a554a083d5bf33c9211e07250f90428 to your computer and use it in GitHub Desktop.
Save keizo042/5a554a083d5bf33c9211e07250f90428 to your computer and use it in GitHub Desktop.
Dummy Code to ideal sample for "quic" package
module Main where
import Network.QUIC
-- Dummy Code : Simple QUIC Client to Echo Server
main = do
manager <- newManager defaultManagerSettings
ctx <- handshake manager "loclahost" 8080
send ctx "1st hello"
send ctx "2nd hello"
r1 <- recv ctx
r2 <- recv ctx
print r1
print r2
module Main where
import Control.Monad (forever)
import Network.QUIC
main :: IO ()
main = do
manager <- newManager defaultSettings
echo manager
echo :: Manager -> IO ()
echo mgr = forever $ do
ctx <- accept mgr
bs <- recv ctx
print bs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment