diff options
author | AndrewRademacher <andrewrademacher@gmail.com> | 2016-02-28 12:58:56 -0600 |
---|---|---|
committer | AndrewRademacher <andrewrademacher@gmail.com> | 2016-02-28 12:58:56 -0600 |
commit | f82a8dfc7e9b79ca6b88235d7297252adbb6d364 (patch) | |
tree | 8eccc25ea8f4ed3e45e1f1a0b0158ccb9324dcb8 /src/Graylog/Types.hs | |
parent | b23afe7b9089b3177d9aee994464f72e52efbd2a (diff) | |
download | haskell-graylog-f82a8dfc7e9b79ca6b88235d7297252adbb6d364.tar.gz haskell-graylog-f82a8dfc7e9b79ca6b88235d7297252adbb6d364.tar.zst haskell-graylog-f82a8dfc7e9b79ca6b88235d7297252adbb6d364.zip |
Implemented UDP chunking.
Diffstat (limited to 'src/Graylog/Types.hs')
-rw-r--r-- | src/Graylog/Types.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Graylog/Types.hs b/src/Graylog/Types.hs index 8fad8cc..5c32a8b 100644 --- a/src/Graylog/Types.hs +++ b/src/Graylog/Types.hs | |||
@@ -8,6 +8,7 @@ module Graylog.Types | |||
8 | , _graylogAddress | 8 | , _graylogAddress |
9 | , _graylogSocket | 9 | , _graylogSocket |
10 | , _graylogHostName | 10 | , _graylogHostName |
11 | , _graylogChunkSize | ||
11 | , ChunkSize | 12 | , ChunkSize |
12 | 13 | ||
13 | , defaultChunkSize | 14 | , defaultChunkSize |
@@ -38,7 +39,9 @@ defaultChunkSize = 8192 | |||
38 | 39 | ||
39 | openGraylog | 40 | openGraylog |
40 | :: HostName -> ServiceName -> ChunkSize -> IO (Either String Graylog) | 41 | :: HostName -> ServiceName -> ChunkSize -> IO (Either String Graylog) |
41 | openGraylog h p cksize = getAddrInfo Nothing (Just h) (Just p) >>= \case | 42 | openGraylog h p cksize |
43 | | cksize < 1024 = return $ Left "ChunkSize must be at least 1024." | ||
44 | | otherwise = getAddrInfo Nothing (Just h) (Just p) >>= \case | ||
42 | [] -> return $ Left "No address info found." | 45 | [] -> return $ Left "No address info found." |
43 | infos -> | 46 | infos -> |
44 | case find (\i -> addrSocketType i == Datagram) infos of | 47 | case find (\i -> addrSocketType i == Datagram) infos of |