-- | Receive a buffer of bytes.
recvBufFrom :: Socket -> Ptr Word8 -> Int -> IO (Int, SockAddr)
recvBufFrom sock ptr n = do (str,len,sa) <- recvFrom sock n
                            pokeArray ptr ((map (fromIntegral . ord) str) :: [Word8])
                            return (len,sa)

-- | Send a buffer of bytes.
recvBufFrom :: Socket -> Ptr Word8 -> Int -> IO (Int, SockAddr)
recvBufFrom sock ptr n = do (str,len,sa) <- recvFrom sock n
                            pokeArray ptr ((map (fromIntegral . ord) str) :: [Word8])
                            return (len,sa)

-- | Send a buffer of bytes.
recvBufFrom sock ptr n = do (str,len,sa) <- recvFrom sock n
                            pokeArray ptr ((map (fromIntegral . ord) str) :: [Word8])
                            return (len,sa)

-- | Send a buffer of bytes.