From 3fdd5ee1ede2e4776dc49269793d245e3ef8580a Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Fri, 3 Jan 2020 01:33:22 -0500 Subject: Fixed history-edit error: tcpclient.hs belongs under dht/ --- examples/tcpclient.hs | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 examples/tcpclient.hs (limited to 'examples') diff --git a/examples/tcpclient.hs b/examples/tcpclient.hs deleted file mode 100644 index d168b1fb..00000000 --- a/examples/tcpclient.hs +++ /dev/null @@ -1,49 +0,0 @@ -import Control.Monad -import Control.Concurrent -import Control.Concurrent.STM -import System.Environment - -import Crypto.Tox -import Network.Tox.TCP -import Network.QueryResponse -import DebugTag -import DPut - -main :: IO () -main = do - setVerbose XMisc - setVerbose XTCP - setVerbose XUnexpected - crypto <- newCrypto - (_,client) <- newClient crypto id (\cb p -> cb (Just (False,p))) - quitTCP <- forkListener "TCP-recv" (addHandler print (handleMessage client) $ clientNet client) - args <- getArgs - let addr = read $ args !! 0 - - putStrLn $ unlines - [ "-------------------------------" - , "PING TEST" - , "-------------------------------" - , "ping " ++ show addr - ] - r <- tcpPing client (addr :: NodeInfo) - print r - - forM_ (drop 1 args) $ (. read) $ \gw -> do - putStrLn $ unlines - [ "-------------------------------" - , "GetNodes TEST" - , "-------------------------------" - ] - -- getUDPNodes :: TCPClient err () Nonce8 -> NodeId -> UDP.NodeInfo -> IO (Maybe ([UDP.NodeInfo], [UDP.NodeInfo], Maybe ())) - let nid = read "OrjBG.GyWuQhGc1pb0KssgmYAocohFh35Vx8mREC9Nu" - s <- getUDPNodes (TCPClient crypto client $ \_ -> return $ Just gw) nid (udpNodeInfo addr) - print s - - putStrLn $ unlines - [ "-------------------------------" - , "quitTCP" - , "-------------------------------" - ] - quitTCP - return () -- cgit v1.2.3