I followed the tcpEcho example to create a stream to split lines from data 
coming from a tcp connection. My code look like this

val serverAddress = new InetSocketAddress("127.0.0.1", 6000)

val serverFuture = (IO(StreamTcp) ? StreamTcp.Bind(settings = settings, 
localAddress = serverAddress))

  serverFuture.onSuccess {

      case serverBinding: StreamTcp.TcpServerBinding =>

        println("Server started, listening on: " + serverBinding.
localAddress)

        Flow(serverBinding.connectionStream)

        .foreach { conn ⇒

          println("Client connected from: " + conn.remoteAddress)

          Flow(conn.inputStream).map(_.utf8String.split("\n")).consume(
materializer)

        }.consume(materializer)

}


after I run it, the log only have:

[DEBUG] [05/28/2014 14:20:56.235] 
[ClientAndServer-akka.actor.default-dispatcher-3] 
[akka.tcp://[email protected]:2551/system/IO-TCP/selectors/$a/0] 
Successfully bound to /127.0.0.1:6000

Server started, listening on: /127.0.0.1:6000

[DEBUG] [05/28/2014 14:21:02.571] 
[ClientAndServer-akka.actor.default-dispatcher-4] 
[akka.tcp://[email protected]:2551/system/IO-TCP/selectors/$a/0] 
New connection accepted

Client connected from: /127.0.0.1:51552

[DEBUG] [05/28/2014 14:21:02.596] 
[ClientAndServer-akka.actor.default-dispatcher-4] 
[akka://ClientAndServer/user/$a/$b] received handled message 
RequestMore(akka.stream.impl.ActorSubscription@7eac4d3b,16)

[DEBUG] [05/28/2014 14:21:02.596] 
[ClientAndServer-akka.actor.default-dispatcher-19] 
[akka://ClientAndServer/user/$a/$c] received handled message 
RequestMore(akka.stream.impl.ActorSubscription@7f1fc4b8,4)

[DEBUG] [05/28/2014 14:21:07.599] 
[ClientAndServer-akka.actor.default-dispatcher-3] 
[akka.tcp://[email protected]:2551/system/IO-TCP/selectors/$a/1] 
Configured registration timeout of [5000 milliseconds] expired, stopping


Did I miss something?

-- 
>>>>>>>>>>      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