selecting on 2 streams will continue after the first stream ends. In our case, our network stream will end when the socket is cleanly closed by the server but the channel stream will continue. Replace select with a custom stream which throws error when network stream ends
select
ing on 2 streams will continue after the first stream ends. In our case, our network stream will end when the socket is cleanly closed by the server but the channel stream will continue. Replace select with a custom stream which throws error when network stream ends