I'm new to akka-stream and attempting to use the library as a client to read (and only read) from a remote TCP server socket.
My attempts however fail as no incoming ByteStrings are being processed.
neither:
Source.empty[ByteString]
.via(Tcp().outgoingConnection(address, port))
.to(Sink.foreach(println(_))).run()
nor:
val connection = Tcp().outgoingConnection(address, port)
val sink = Flow[ByteString]
.via(Framing.delimiter(
ByteString("\n"),
maximumFrameLength = 256,
allowTruncation = true))
.map(_.utf8String)
.to(Sink.foreach(println(_)))
connection.
runWith(Source.empty, sink)
works.
What are the reasons for the flows not being run? All hints much appreciated.