go-libp2p-circuit icon indicating copy to clipboard operation
go-libp2p-circuit copied to clipboard

Preemptively close stream in CanHop

Open Ichbinjoe opened this issue 6 years ago • 5 comments
trafficstars

Since we are done writing, we can close the write side of the stream before reading the resulting status.

Closes https://github.com/libp2p/go-libp2p-circuit/issues/18

Ichbinjoe avatar Dec 27 '18 00:12 Ichbinjoe

does this add anything useful in terms of behaviour?

vyzo avatar Dec 27 '18 07:12 vyzo

Also, we need to make sure this doesn't break js.

vyzo avatar Dec 27 '18 07:12 vyzo

The only behavioral change this may bring is that our side will appear to hang up marginally sooner than previously.

You can see the discussion more in #18

Ichbinjoe avatar Dec 27 '18 17:12 Ichbinjoe

Se still need to test this against JS, just in case. JS may close the entire stream prematurely when it receives a EOF on the read side.

Stebalien avatar Jan 03 '19 23:01 Stebalien

ping @vasco-santos

Stebalien avatar Jun 24 '20 19:06 Stebalien