Browse Source

QuoteSourceServer: ZAP domain

master
Denis Tereshkin 8 years ago
parent
commit
5ef020679b
  1. 2
      libatrade.cabal
  2. 8
      src/ATrade/QuoteSource/Server.hs

2
libatrade.cabal

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
name: libatrade
version: 0.3.0.0
version: 0.4.0.0
synopsis: ATrade infrastructure core library
description: Please see README.md
homepage: https://github.com/asakul/libatrade.git

8
src/ATrade/QuoteSource/Server.hs

@ -20,6 +20,7 @@ import Data.List.NonEmpty hiding (map) @@ -20,6 +20,7 @@ import Data.List.NonEmpty hiding (map)
import Data.Maybe
import System.Log.Logger
import System.ZMQ4
import System.ZMQ4.ZAP
import Prelude hiding ((!!))
import Safe
@ -79,10 +80,13 @@ serverThread state = do @@ -79,10 +80,13 @@ serverThread state = do
header = BL.fromStrict . E.encodeUtf8 $ secName
body = BL.concat $ map serializeTickBody ticklist
startQuoteSourceServer :: BoundedChan QuoteSourceServerData -> Context -> T.Text -> IO QuoteSourceServer
startQuoteSourceServer chan c ep = do
startQuoteSourceServer :: BoundedChan QuoteSourceServerData -> Context -> T.Text -> Maybe DomainId -> IO QuoteSourceServer
startQuoteSourceServer chan c ep socketDomainIdMb = do
sock <- socket c Pub
setLinger (restrict 0) sock
case socketDomainIdMb of
Just socketDomainId -> setZapDomain socketDomainId sock
_ -> return ()
bind sock $ T.unpack ep
tid <- myThreadId
hbTid <- forkIO $ forever $ do

Loading…
Cancel
Save