Hi all,
I'm very new to Akka Streams, trying to get the ideas behind the streams
and how to use them. I'd like to make a very simple thing: to connect two
TCP server sockets, but I get stuck with that.
If I have server and client connections, it more or less clear for me:
val conn = Tcp().bind("localhost", 1234)
val out = Tcp().outgoingConnection("localhost", 2345)
val handler = Sink.foreach[Tcp.IncomingConnection] { c =>
println("Got connection from " + c.remoteAddress)
c.handleWith(out)
}
conn.to(handler).run()
This working for one connection. Could anybody give me a clue how to get
it work with more that one incoming connections (I suppose I need to use
Merge, or Source.combine)?
And the second question. As I understand this works in one direction
(from server socket to client). How can I use BidiFlow in such situation?
Finally, If I have two server connections I have no idea how to achieve
same result. Should I use mutable state to store incoming connections?
--
BR,
Mike.
--
>>>>>>>>>> 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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.