diff options
author | joe <joe@jerkface.net> | 2013-07-15 14:22:37 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-07-15 14:22:37 -0400 |
commit | be81364d881a30508dceeb0f100bc1da0597d859 (patch) | |
tree | a4272c8f827e6b5209994feb9a58e80b3f3c49b2 /Presence/ServerC.hs | |
parent | 43d147c7470edea26656987b8b16d08beae93e45 (diff) |
Moved all output to module: Logging
Diffstat (limited to 'Presence/ServerC.hs')
-rw-r--r-- | Presence/ServerC.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Presence/ServerC.hs b/Presence/ServerC.hs index 02c6446e..d8cca897 100644 --- a/Presence/ServerC.hs +++ b/Presence/ServerC.hs | |||
@@ -12,8 +12,7 @@ module ServerC | |||
12 | ) where | 12 | ) where |
13 | 13 | ||
14 | import Network.Socket as Socket | 14 | import Network.Socket as Socket |
15 | import Data.ByteString.Lazy.Char8 as L | 15 | import Logging |
16 | ( putStrLn ) | ||
17 | import Data.ByteString.Char8 | 16 | import Data.ByteString.Char8 |
18 | ( hGetNonBlocking | 17 | ( hGetNonBlocking |
19 | ) | 18 | ) |
@@ -97,10 +96,10 @@ doServer (HCons family port) g = runServer port (runConn g) | |||
97 | "resource exhausted" -> return Retry | 96 | "resource exhausted" -> return Retry |
98 | 97 | ||
99 | -- InvalidArgument | 98 | -- InvalidArgument |
100 | "invalid argument" -> L.putStrLn "quit accept-loop." >> return QuitOnException | 99 | "invalid argument" -> debugL "quit accept-loop." >> return QuitOnException |
101 | 100 | ||
102 | _ -> do | 101 | _ -> do |
103 | L.putStrLn ("accept-loop exception: " <++> bshow ioerror <++> "\n") | 102 | debugL ("accept-loop exception: " <++> bshow ioerror <++> "\n") |
104 | return QuitOnException | 103 | return QuitOnException |
105 | 104 | ||
106 | mcon <- handle doException $ fix $ \loop -> do | 105 | mcon <- handle doException $ fix $ \loop -> do |
@@ -146,6 +145,6 @@ runConn :: | |||
146 | runConn g st (sock,_) = do | 145 | runConn g st (sock,_) = do |
147 | h <- socketToHandle sock ReadWriteMode | 146 | h <- socketToHandle sock ReadWriteMode |
148 | hSetBuffering h NoBuffering | 147 | hSetBuffering h NoBuffering |
149 | let doException (SomeException e) = Prelude.putStrLn ("\n\nexception: " ++ show e ++ "\n\n") | 148 | let doException (SomeException e) = debugStr ("\n\nexception: " ++ show e ++ "\n\n") |
150 | handle doException (g (restrictSocket sock `HCons` st) (packets h) (packetSink h)) | 149 | handle doException (g (restrictSocket sock `HCons` st) (packets h) (packetSink h)) |
151 | hClose h | 150 | hClose h |