IPv6 only, noone needs legacy stuff
This commit is contained in:
parent
3faa4a8d61
commit
e13dac4ded
|
@ -13,6 +13,7 @@ import qualified Data.ByteString.UTF8 as BSU
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
sock <- socket AF_INET6 Datagram defaultProtocol
|
sock <- socket AF_INET6 Datagram defaultProtocol
|
||||||
|
setSocketOption sock IPv6Only 1
|
||||||
-- lookup destination to get a SockAddr
|
-- lookup destination to get a SockAddr
|
||||||
let hints = defaultHints { addrFamily = AF_INET6, addrSocketType = Datagram}
|
let hints = defaultHints { addrFamily = AF_INET6, addrSocketType = Datagram}
|
||||||
destAddr <- addrAddress . head <$> getAddrInfo (Just hints) (Just "::1") (Just "7331")
|
destAddr <- addrAddress . head <$> getAddrInfo (Just hints) (Just "::1") (Just "7331")
|
||||||
|
|
|
@ -14,6 +14,7 @@ import qualified Data.ByteString as BS
|
||||||
|
|
||||||
main = do
|
main = do
|
||||||
sock <- socket AF_INET6 Datagram defaultProtocol
|
sock <- socket AF_INET6 Datagram defaultProtocol
|
||||||
|
setSocketOption sock IPv6Only 1
|
||||||
-- lookup destination to get a SockAddr
|
-- lookup destination to get a SockAddr
|
||||||
let hints = defaultHints { addrFamily = AF_INET6, addrSocketType = Datagram}
|
let hints = defaultHints { addrFamily = AF_INET6, addrSocketType = Datagram}
|
||||||
serverAddr <- addrAddress . head <$> getAddrInfo (Just hints) (Just "::1") (Just "7331")
|
serverAddr <- addrAddress . head <$> getAddrInfo (Just hints) (Just "::1") (Just "7331")
|
||||||
|
|
Loading…
Reference in a new issue