Closed avieth closed 7 years ago
In general it looks good, though what I'm concerned about are:
we need some tests that will make semantics explicit and make corner cases at explicit.
Test fails. Either some problem in test was uncovered (this happened before) or there is some problem with code.
(possibly not a problem) we have some sort of a handshake during channels close and creation. When we block local socket will remote side also happy about what had happens.
I gave this a bit more thought and I think #46 is a better approach. It doesn't implement blocking of input as this one does, but rather queueing and buffering controls.
Closing in favour of #46
This is just one idea for how network-transport ticket 32 could be realized in network-transport-tcp. This changeset doesn't assume any changes to network-transport, but shows how we might create
EndPoint
s by giving aPolicy
for accepting input. So the abstract API would change to include something likenewEndPoint :: Transport -> Policy -> IO (Either Error EndPoint)
See the example included
examples/Block.hs
.Please share your thoughts! What do you like? What don't you like? Is this a horrible idea?