net-io

(after #442)

This PR changes net to use `io` instead of channels.
At the moment it's just `conn`, but soon more.
:heart:

On Wed, Dec 17, 2014 at 4:57 PM, Brian Tiger Chow <notifications@github.com>
wrote:
>
> In net/mock/mock.go
> <https://github.com/jbenet/go-ipfs/pull/443#discussion-diff-22017667>:
>
> > +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) {
>
> the mock net is seriously awesome.
>
> [image: :christmas_tree:] [image: :gift:]
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jbenet/go-ipfs/pull/443/files#r22017667>.
>