net-io

(after #442)

This PR changes net to use `io` instead of channels.
At the moment it's just `conn`, but soon more.
> doesn't do the one thing I've been practically begging for.

are you sure about that? can you give me an example? because here's adding
peers: 53a1f4e

On Wed, Dec 17, 2014 at 8:55 AM, Brian Tiger Chow <notifications@github.com>
wrote:
>
> In net/mock/mock.go
> <https://github.com/jbenet/go-ipfs/pull/443#discussion-diff-21985869>:
>
> > +func (c *Conn) RemotePeer() peer.Peer {
> > +	return c.remote.local
> > +}
> > +
> > +// network implements the Network interface,
> > +type Network struct {
> > +	local peer.Peer // local peer
> > +	mux   inet.Mux  // protocol multiplexing
> > +
> > +	conns map[peer.Peer]*Conn
> > +	sync.RWMutex
> > +
> > +	cg ctxgroup.ContextGroup // for Context closing
> > +}
> > +
> > +func MakeNetworks(ctx context.Context, peers []peer.Peer) (nets []*Network, err error) {
>
>  I need this interface for the kinds of tests I want to run.
>
> I'm still learning to appreciate that for every proclivity, there exists a
> spectrum. (I'm very much a gradual refinement kinda guy.)
>
> I totally understand where you're coming from. It's just that it does a
> lot of stuff but doesn't do the one thing I've been practically begging
> for. [image: :cry:]
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jbenet/go-ipfs/pull/443/files#r21985869>.
>