Skip to content

Commit 906d8d5

Browse files
committed
Fix compilation errors
1 parent e22041b commit 906d8d5

File tree

6 files changed

+76
-8
lines changed

6 files changed

+76
-8
lines changed

io/js/src/main/scala/fs2/io/net/SocketInfoPlatform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ package fs2
2323
package io
2424
package net
2525

26-
import com.comcast.ip4s.{GenSocketAddress, SocketAddress}
26+
import com.comcast.ip4s.GenSocketAddress
2727
import cats.effect.Async
2828
import fs2.io.internal.facade
2929

io/js/src/main/scala/fs2/io/net/UnixSocketsProviderPlatform.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,18 @@ package fs2
2323
package io
2424
package net
2525

26-
import cats.effect.{Async, Resource}
26+
import cats.effect.{Async, LiftIO, Resource}
2727
import cats.syntax.all._
2828
import com.comcast.ip4s.UnixSocketAddress
2929
import fs2.io.file.{Files, Path}
3030

3131
private[net] trait UnixSocketsProviderCompanionPlatform {
3232

33+
private[net] def forLiftIO[F[_]: Async: LiftIO]: UnixSocketsProvider[F] = {
34+
val _ = LiftIO[F]
35+
forAsync[F]
36+
}
37+
3338
private[net] def forAsync[F[_]: Async]: UnixSocketsProvider[F] =
3439
forAsyncAndFiles(implicitly, Files.forAsync[F])
3540

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2013 Functional Streams for Scala
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
5+
* this software and associated documentation files (the "Software"), to deal in
6+
* the Software without restriction, including without limitation the rights to
7+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8+
* the Software, and to permit persons to whom the Software is furnished to do so,
9+
* subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
*/
21+
22+
package fs2
23+
package io
24+
package net
25+
26+
import cats.effect.Async
27+
28+
private[net] trait IpSocketsProviderCompanionPlatform { self: IpSocketsProvider.type =>
29+
30+
private[net] def forAsync[F[_]: Async]: IpSocketsProvider[F] =
31+
AsynchronousChannelGroupIpSocketsProvider.forAsync[F]
32+
}

io/jvm/src/main/scala/fs2/io/net/NetworkPlatform.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ private[net] trait NetworkCompanionPlatform extends NetworkLowPriority { self: N
160160

161161
def forAsyncAndDns[F[_]](implicit F: Async[F], dns: Dns[F]): Network[F] =
162162
new AsyncNetwork[F] {
163-
private lazy val ipSockets = AsynchronousChannelGroupIpSocketsProvider.forAsync[F]
163+
private lazy val ipSockets = IpSocketsProvider.forAsync[F]
164164
private lazy val unixSockets = UnixSocketsProvider.forAsync[F]
165165
private lazy val globalDatagramSocketGroup = DatagramSocketGroup.unsafe[F](globalAdsg)
166166

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright (c) 2013 Functional Streams for Scala
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
5+
* this software and associated documentation files (the "Software"), to deal in
6+
* the Software without restriction, including without limitation the rights to
7+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8+
* the Software, and to permit persons to whom the Software is furnished to do so,
9+
* subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
*/
21+
22+
package fs2
23+
package io
24+
package net
25+
26+
import cats.effect.{Async, LiftIO}
27+
import com.comcast.ip4s.Dns
28+
29+
private[net] trait IpSocketsProviderCompanionPlatform { self: IpSocketsProvider.type =>
30+
31+
private[net] def forLiftIO[F[_]: Async: LiftIO]: IpSocketsProvider[F] =
32+
new FdPollingIpSocketsProvider[F]()(Dns.forAsync, implicitly, implicitly)
33+
}

io/shared/src/main/scala/fs2/io/net/unixsocket/UnixSockets.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,12 @@ object UnixSockets {
5555

5656
def forIO: UnixSockets[IO] = forLiftIO
5757

58-
implicit def forLiftIO[F[_]: Async: LiftIO]: UnixSockets[F] = {
59-
val _ = LiftIO[F]
58+
implicit def forLiftIO[F[_]: Async: LiftIO]: UnixSockets[F] =
6059
new AsyncUnixSockets[F]
61-
}
6260

63-
private class AsyncUnixSockets[F[_]: Async] extends UnixSockets[F] {
61+
private class AsyncUnixSockets[F[_]: Async: LiftIO] extends UnixSockets[F] {
6462

65-
private val delegate = UnixSocketsProvider.forAsync[F]
63+
private val delegate = UnixSocketsProvider.forLiftIO[F]
6664

6765
def client(address: UnixSocketAddress): Resource[F, Socket[F]] =
6866
delegate.connect(Ip4sUnixSocketAddress(address.path), Nil)

0 commit comments

Comments
 (0)