<commit_before>{-# LANGUAGE CPP, ForeignFunctionInterface #-}

#include <sys/socket.h>
#include <arpa/inet.h>

#include <netinet/in.h>
#include <netinet/tcp.h>

-- | Network module for proxy pool, fixes everything that's wrong with Haskell's network package
module ProxyPool.Network (configureKeepAlive, connectTimeout, serialiseAddr) where

import Foreign
import Foreign.C

import System.IO.Unsafe (unsafePerformIO)

import Network
import Network.Socket
import Network.Socket.Internal

import Control.Concurrent.MVar

import System.Posix.Types
import System.Posix.IO.Select
import System.Posix.IO.Select.Types

foreign import ccall unsafe "setsockopt"
    -- socket, level, option_name, option_value, option_len
    c_setsockopt :: CInt -> CInt -> CInt -> Ptr CInt -> CInt -> IO CInt

foreign import ccall unsafe "connect"
    c_connect :: CInt -> Ptr SockAddr -> CInt -> IO CInt
<commit_msg>Add back hiding for compat<commit_after>{-# LANGUAGE CPP, ForeignFunctionInterface #-}

#include <sys/socket.h>
#include <arpa/inet.h>

#include <netinet/in.h>
#include <netinet/tcp.h>

-- | Network module for proxy pool, fixes everything that's wrong with Haskell's network package
module ProxyPool.Network (configureKeepAlive, connectTimeout, serialiseAddr) where

import Foreign hiding (unsafePerformIO)
import Foreign.C

import System.IO.Unsafe (unsafePerformIO)

import Network
import Network.Socket
import Network.Socket.Internal

import Control.Concurrent.MVar

import System.Posix.Types
import System.Posix.IO.Select
import System.Posix.IO.Select.Types

foreign import ccall unsafe "setsockopt"
    -- socket, level, option_name, option_value, option_len
    c_setsockopt :: CInt -> CInt -> CInt -> Ptr CInt -> CInt -> IO CInt

foreign import ccall unsafe "connect"
    c_connect :: CInt -> Ptr SockAddr -> CInt -> IO CInt

{'fraction_non_alphanumeric': 0.09978070175438597, 'fraction_numerical': 0.0, 'mean_word_length': 4.615384615384615, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7351650', 'n_tokens_mistral': 589, 'n_tokens_neox': 571, 'n_words': 172}