Closing connections in TCP streams

23 views
Skip to first unread message

Ole Hjalmar Herje

unread,
Dec 6, 2017, 7:11:19 AM12/6/17
to Akka User List
Can someone explain how to properly close incoming and outgoing Tcp connections that are created with Tcp.get(system).bind("127.0.0.1", 8888); and Tcp.get(system).outgoingConnection("127.0.0.1", 8888); ?

The documentation states "Closing connections is possible by cancelling the incoming connection Flow from your server logic (e.g. by connecting its downstream to a Sink.cancelled() and its upstream to a Source.empty()). It is also possible to shut down the server’s socket by cancelling the IncomingConnection source connections." for incoming connections, but I am not able to translate that into (Java) code. I could not find any documentation on how to properly close outgoing connections. 

Ole Hjalmar Herje

unread,
Dec 6, 2017, 7:39:39 AM12/6/17
to Akka User List
Will a KillSwitch connected to the flows close the underlying tcp connections as well as completing the streams?
Reply all
Reply to author
Forward
0 new messages