Skip to content

Instantly share code, notes, and snippets.

@caniszczyk
Created February 10, 2014 17:52
Show Gist options
  • Select an option

  • Save caniszczyk/8920827 to your computer and use it in GitHub Desktop.

Select an option

Save caniszczyk/8920827 to your computer and use it in GitHub Desktop.

Revisions

  1. caniszczyk created this gist Feb 10, 2014.
    16 changes: 16 additions & 0 deletions gistfile1.scala
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    object Netty3Transporter {
    val channelFactory: ChannelFactory =
    new NioClientSocketChannelFactory(
    Executor, 1 /*# boss threads*/, WorkerPool, DefaultTimer
    ){
    // no-op; unreleasable
    override def releaseExternalResources() = ()
    } #1
    val defaultChannelOptions: Map[String, Object] = Map(
    "tcpNoDelay" -> java.lang.Boolean.TRUE,
    "reuseAddress" -> java.lang.Boolean.TRUE #2
    )
    }

    // #1 Create a new ChannelFactory instance
    // #2 Set options which are used for new Channels.