diff options
author | joe <joe@jerkface.net> | 2013-06-27 22:06:31 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-06-27 22:06:31 -0400 |
commit | 61e76eb99c74aa4c0769e2fe7f280b9a4530171d (patch) | |
tree | 3c0666fa38d1d68180add0b2ce7a8bf4593f69df /Presence/main.hs | |
parent | 79887be9ef0d95a44e7fdad1a143aaca28947eb8 (diff) |
Converted to SocketLike and quitListening interfaces.
Paving the way for conversion to conduits-based server over HaXml.
Diffstat (limited to 'Presence/main.hs')
-rw-r--r-- | Presence/main.hs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Presence/main.hs b/Presence/main.hs index 74589a41..a0a80569 100644 --- a/Presence/main.hs +++ b/Presence/main.hs | |||
@@ -27,7 +27,6 @@ import UTmp | |||
27 | import FGConsole | 27 | import FGConsole |
28 | import XMPPServer | 28 | import XMPPServer |
29 | import Data.HList | 29 | import Data.HList |
30 | import Network.Socket (sClose) | ||
31 | import Control.Exception | 30 | import Control.Exception |
32 | import LocalPeerCred | 31 | import LocalPeerCred |
33 | import System.Posix.User | 32 | import System.Posix.User |
@@ -223,16 +222,16 @@ start ip4or6 = do | |||
223 | utmp_file | 222 | utmp_file |
224 | dologin | 223 | dologin |
225 | #endif | 224 | #endif |
226 | sockLocals <- listenForXmppClients ip4or6 (UnixSessions tracked) 5222 HNil | 225 | clients <- listenForXmppClients ip4or6 (UnixSessions tracked) 5222 HNil |
227 | sockRemotes <- listenForRemotePeers ip4or6 (UnixSessions tracked) 5269 HNil | 226 | peers <- listenForRemotePeers ip4or6 (UnixSessions tracked) 5269 HNil |
228 | 227 | ||
229 | threadDelay 1000 -- wait a moment to obtain current tty | 228 | threadDelay 1000 -- wait a moment to obtain current tty |
230 | dologin () | 229 | dologin () |
231 | putStrLn "\nHit enter to terminate...\n" | 230 | putStrLn "\nHit enter to terminate...\n" |
232 | getLine | 231 | getLine |
233 | killThread remotes | 232 | killThread remotes |
234 | sClose sockLocals | 233 | quitListening clients |
235 | sClose sockRemotes | 234 | quitListening peers |
236 | -- threadDelay 1000 | 235 | -- threadDelay 1000 |
237 | putStrLn "closed listener." | 236 | putStrLn "closed listener." |
238 | unmonitorTTY mtty | 237 | unmonitorTTY mtty |