=doc show where connections are coming from in stream-io.rst

This commit is contained in:
2beaucoup 2015-11-13 09:01:16 +01:00
parent 4e127e6206
commit 6ba1e481d3
2 changed files with 4 additions and 5 deletions

View file

@ -38,13 +38,12 @@ class StreamTcpDocSpec extends AkkaSpec {
//#echo-server-simple-bind
}
{
val localhost = TestUtils.temporaryServerAddress()
val connections: Source[IncomingConnection, Future[ServerBinding]] =
Tcp().bind(localhost.getHostName, localhost.getPort) // TODO getHostString in Java7
val (host, port) = TestUtils.temporaryServerHostnameAndPort()
//#echo-server-simple-handle
import akka.stream.io.Framing
val connections: Source[IncomingConnection, Future[ServerBinding]] =
Tcp().bind(host, port)
connections runForeach { connection =>
println(s"New connection from: ${connection.remoteAddress}")