If connTwo is closed, Read will return io.EOF, and io.Copy will return.
(With no error, because copy runs until io.EOF is reached).

If that's not happening for you, can you give an example to reproduce?

On 16 November 2016 at 14:49, Alexander Menzhinsky <amenzhin...@gmail.com>
wrote:

> When implementing a proxy server I would like to stop reading from a
> connection when another is closed. I use the io.Copy but basically it uses
> the Read function.
> go io.Copy(connOne, connTwo)
>
> Is it possible?
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to