Skip to content
Permalink
Browse files

Convenience constructors.

  • Loading branch information...
Qthunder committed Aug 6, 2019
1 parent c4ebfdd commit a1da5bf3ab353858cda0a1c46cbf0dd460187dc5
@@ -125,7 +125,8 @@ final class SocketGroup(channelGroup: AsynchronousChannelGroup, blocker: Blocker
maxQueued: Int = 0,
reuseAddress: Boolean = true,
receiveBufferSize: Int = 256 * 1024,
additionalSocketOptions: List[SocketOptionMapping[_]] = List.empty)(
additionalSocketOptions: List[SocketOptionMapping[_]] =
List.empty)(
implicit F: Concurrent[F],
CS: ContextShift[F]
): Stream[F, Either[InetSocketAddress, Resource[F, Socket[F]]]] = {
@@ -4,3 +4,10 @@ import java.net.SocketOption

/** Key-value pair of [[SocketOption]] and a corresponding value**/
final case class SocketOptionMapping[A](key: SocketOption[A], value: A)
object SocketOptionMapping {
def boolean(key: SocketOption[java.lang.Boolean],
value: Boolean): SocketOptionMapping[java.lang.Boolean] =
SocketOptionMapping(key, value)
def integer(key: SocketOption[java.lang.Integer],
value: Int): SocketOptionMapping[java.lang.Integer] = SocketOptionMapping(key, value)
}

0 comments on commit a1da5bf

Please sign in to comment.
You can’t perform that action at this time.