Hi Bill,
can you explain on a higher level what you are trying to achieve?
IIUC the CLOSE_WAIT state represents a half-closed TCP connection
where the peer already has closed the connection (= won't send more
data) but may or may not still be able to receive data. On the Akka IO
level this state is supported by using
`Tcp.Register(keepOpenOnPeerClose = true)`.
For HTTP, however, it is not specified how a client-side connection
closure should be interpreted (e.g. see [1]). Rules wrt to closing the
connection in RFC 7230 [2] seem to imply that a server usually expects
client-side connection closure only after the response was received.
The rules leave room to interpret a "premature" client-side connection
closure as an abortion (e.g. because of timeout) by the client. Also,
SSL/TLS doesn't support half-closed connections at all.
For this reason we decided at some point that we don't support
client-side half-closed connections but react to a client-side
connection closure by immediately cancelling all the ongoing requests
on this connection and close the connection from the server-side as
well.
So, what is the solution? If you don't control the client-side I'm
afraid there's no way to make spray behave the way you want (= keeping
the connection open if the client has closed the connection) by
configuration. If you just want to support long-living HTTP
connections, then this is possible by disabling all the timeouts that
usually guard you from leaking connections too easily.
Btw. Akka IO and spray are asynchronous and Actor-based so that
holding to a thread won't usually block any concurrent processing like
handling network and timeout events (modulo thread-starvation).
HTH
Johannes
[1]
https://www.ruby-forum.com/topic/165035
[2]
http://tools.ietf.org/html/rfc7230#section-6.6
> --
> You received this message because you are subscribed to the Google Groups
> "
spray.io User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
spray-user+...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/spray-user.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/spray-user/914c41d7-1206-4a61-83b3-88d3d2e708d4%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
--
Johannes
-----------------------------------------------
Johannes Rudolph
http://virtual-void.net