@@ -27,7 +27,7 @@ import cats.effect.{Async, Resource}
27
27
import cats .effect .std .Dispatcher
28
28
import cats .effect .syntax .all ._
29
29
import cats .syntax .all ._
30
- import com .comcast .ip4s .{IpAddress , Port , SocketAddress , UnixSocketAddress }
30
+ import com .comcast .ip4s .{Host , IpAddress , Port , SocketAddress , UnixSocketAddress }
31
31
import fs2 .concurrent .Channel
32
32
import fs2 .io .internal .facade
33
33
@@ -39,7 +39,7 @@ private[net] abstract class AsyncSocketsProvider[F[_]](implicit F: Async[F]) {
39
39
options.traverse_(option => option.key.set(socket, option.value))
40
40
41
41
protected def connectIpOrUnix (
42
- to : Either [SocketAddress [IpAddress ], UnixSocketAddress ],
42
+ to : Either [SocketAddress [Host ], UnixSocketAddress ],
43
43
options : List [SocketOption ]
44
44
): Resource [F , Socket [F ]] =
45
45
(for {
@@ -92,7 +92,7 @@ private[net] abstract class AsyncSocketsProvider[F[_]](implicit F: Async[F]) {
92
92
} yield socket).adaptError { case IOException (ex) => ex }
93
93
94
94
protected def bindIpOrUnix (
95
- address : Either [SocketAddress [IpAddress ], UnixSocketAddress ],
95
+ address : Either [SocketAddress [Host ], UnixSocketAddress ],
96
96
options : List [SocketOption ]
97
97
): Resource [F , ServerSocket [F ]] =
98
98
(for {
@@ -125,7 +125,7 @@ private[net] abstract class AsyncSocketsProvider[F[_]](implicit F: Async[F]) {
125
125
} <* F .delay {
126
126
address match {
127
127
case Left (addr) =>
128
- if (addr.host.isWildcard)
128
+ if (addr.host.isInstanceOf [ IpAddress ] && addr.host. asInstanceOf [ IpAddress ]. isWildcard)
129
129
server.listen(addr.port.value, () => cb(Right (())))
130
130
else
131
131
server.listen(addr.port.value, addr.host.toString, () => cb(Right (())))
0 commit comments