diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+# 0.3.2
+- Restore compatibility with network-2.0
+
 # 0.3.1
 - Fix [build errors](https://github.com/commercialhaskell/stackage/issues/4589)
 
diff --git a/network-multicast.cabal b/network-multicast.cabal
--- a/network-multicast.cabal
+++ b/network-multicast.cabal
@@ -1,5 +1,5 @@
 name:               network-multicast
-version:            0.3.1
+version:            0.3.2
 copyright:          2008-2019 Audrey Tang
 license:            PublicDomain
 license-file:       LICENSE
@@ -15,7 +15,7 @@
 extra-source-files: examples/sender.hs examples/receiver.hs ChangeLog
 
 library
-    extensions:         ForeignFunctionInterface, CPP
+    extensions:         ForeignFunctionInterface, CPP, FlexibleInstances
     exposed-modules:    Network.Multicast
     build-depends:      base >= 4 && < 5, network, network-bsd
     hs-source-dirs:     src
diff --git a/src/Network/Multicast.hsc b/src/Network/Multicast.hsc
--- a/src/Network/Multicast.hsc
+++ b/src/Network/Multicast.hsc
@@ -102,11 +102,14 @@
 -- | Converts the from host byte order to network byte order.
 foreign import ccall unsafe "htonl" htonl :: Word32 -> Word32
 
+class IOCompat f where ioCompat :: f -> (Socket -> IO CInt)
+instance IOCompat (Socket -> IO CInt) where ioCompat = id
+instance IOCompat (Socket -> CInt) where ioCompat = (return .)
 
 doSetSocketOption :: Storable a => CInt -> Socket -> a -> IO CInt
 doSetSocketOption ip_multicast_option sock x = alloca $ \ptr -> do
     poke ptr x
-    fd <- fdSocket sock
+    fd <- (ioCompat fdSocket) sock
     c_setsockopt fd _IPPROTO_IP ip_multicast_option (castPtr ptr) (toEnum $ sizeOf x)
 
 -- | Enable or disable the loopback mode on a socket created by 'multicastSender'.
@@ -149,7 +152,7 @@
         Just loc -> Network.Multicast.inet_addr loc
     #{poke struct ip_mreq, imr_multiaddr} mReqPtr addr
     #{poke struct ip_mreq, imr_interface} mReqPtr iface
-    fd <- fdSocket sock
+    fd <- (ioCompat fdSocket) sock
     c_setsockopt fd _IPPROTO_IP flag (castPtr mReqPtr) (#{size struct ip_mreq})
 
 #ifdef mingw32_HOST_OS
