-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHadcc.hs
More file actions
44 lines (39 loc) · 1.37 KB
/
Hadcc.hs
File metadata and controls
44 lines (39 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- |
--- | Main module, startup code
--- |
--- Copyright : (c) Florian Richter 2011
--- License : GPL
---
import Control.Concurrent
import System.Log.Logger
import System.Log.Handler.Simple
import Config
import Filelist
import FilelistTypes
import Filemgmt
import TTH
import DCCommon
import DCToHub
import DCToClient
import Filesystem
import FilesystemHandler
-- | all threads must be started after fuse loading
start appState = do
let config = appConfig appState
searchSocket <- createSearchSocket
forkIO $ startDCServer (configMyIp config) (configMyPort config) (ToClient Nothing DontKnow)
(startupClient appState) (handleClient appState) (stopClient appState)
forkIO $ openDCConnection (configHubIp config) (configHubPort config) ToHub
(startupHub appState) (handleHub appState searchSocket) (\state -> return ())
forkIO $ hashFileList appState
return ()
stop appState = return ()
main = do
config <- loadConfig "Hadcc.cfg"
appState <- newAppState config
initTTHCache appState
loadOwnShare appState
--withMVar (appFileTree appState) (\tree -> putStrLn $ treeNodeToXml tree)
--withMVar (appFileTree appState) (\tree -> putStrLn $ treeNodeToXml tree)
startupFileSystem (configMountpoint config) (start appState) (stop appState) (dcFileInfo appState)
-- vim: sw=4 expandtab