and mapResponse is a PushStage:

def mapResponse(system: ActorSystem) = new PushStage[MTProto, ByteString] {
  private[this] var packageIndex: Int = -1

  override def onPush(elem: MTProto, ctx: Context[ByteString]) = {
    packageIndex += 1
    val pkg = TransportPackage(packageIndex, elem)

    val resBits = TransportPackageCodec.encode(pkg).require
    val res = ByteString(resBits.toByteBuffer)

    elem match {
      case _: Drop ⇒
        ctx.pushAndFinish(res)
      case _ ⇒
        ctx.push(res)
    }
  }




On Sunday, June 7, 2015 at 7:03:01 AM UTC+3, Andrey Kuznetsov wrote:
>
> I am using akka-streams for handling incoming TCP connections. After 
> putting application behind AWS Elastic Load Balancer, it started to fall 
> into "too many open files" problem because of lots of connections in 
> CLOSE_WAIT state. Is there an ability to close such connection on a server 
> side?
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to