Created
August 10, 2017 15:57
-
-
Save keizo042/5a554a083d5bf33c9211e07250f90428 to your computer and use it in GitHub Desktop.
Dummy Code to ideal sample for "quic" package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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