Skip to content

Commit

Permalink
daily
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Bermani committed Jul 23, 2015
1 parent e711199 commit 992f67e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ex/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ main :: IO ()
main =
do result <- connect defaultConf False True
case result of
Left err -> putStrLn "Error"
Left err -> putStrLn "Unable to Connect"
Right msv -> do s <- readMVar msv
request s CurrentTimeReq
businessLogic msv
--businessLogic msv


businessLogic :: MIB -> IO ()
Expand Down
16 changes: 8 additions & 8 deletions src/IB/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,19 @@ greetServer server =
Left errMsg -> throwIO $ IBExc no_valid_id ParseError errMsg
Right val -> do let serv_ver = pre_serverVersion val
twsTime = pre_twsTime val

sCo = server {s_connected= True}
case () of
_ | serv_ver < server_version -> throwIO $ IBExc no_valid_id UpdateTWS ""
| serv_ver >= 3 -> if (serv_ver < min_server_ver_linking)
then write server $ show' ( s_clientId server)
then write sCo $ show' ( s_clientId sCo)
else if (not extraAuth)
then request server StartApi
then request sCo StartApi
else return ()
| otherwise -> return ()
wFlush server
return server { s_twsTime = twsTime
, s_version = serv_ver
, s_connected = True
}
wFlush sCo
return sCo { s_twsTime = twsTime
, s_version = serv_ver
}



Expand Down Expand Up @@ -161,6 +160,7 @@ toServer cc h debug = IBServer { s_addr = cc_addr cc
, s_debug = debug
, s_sock = Just h
, s_timeoutInterval = 100000
, s_connected = False
}

defaultConf :: ClientConfig
Expand Down

0 comments on commit 992f67e

Please sign in to comment.