libp2p / go-libp2p-circuit

Circuit Switching for libp2p
MIT License
48 stars 16 forks source link

Preemptively close stream in CanHop #55

Open Ichbinjoe opened 5 years ago

Ichbinjoe commented 5 years ago

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

vyzo commented 5 years ago

does this add anything useful in terms of behaviour?

vyzo commented 5 years ago

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

Ichbinjoe commented 5 years ago

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

Stebalien commented 5 years ago

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 commented 4 years ago

ping @vasco-santos