Merge pull request #18924 from 2beaucoup/improve-tcp-doc
Show where connections are coming from in stream-io.rst
This commit is contained in:
commit
a394e833bf
2 changed files with 4 additions and 5 deletions
|
|
@ -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}")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue