func (p *Peer) send(msg interface{}) error {
	switch v := msg.(type) {
	case *proto.ClientOfferMsg:
		return p.conn.Notify(p.ctx, proto.ClientOffer, v.Desc)
	case *proto.ClientTrickleMsg:
		return p.conn.Notify(p.ctx, proto.ClientTrickle, v)
	case *proto.ToClientPeersMsg:
		return p.conn.Notify(p.ctx, proto.ClientOnList, v)
	case *proto.FromIslbStreamAddMsg:
		return p.conn.Notify(p.ctx, proto.ClientOnStreamAdd, v)
	case *proto.ToClientPeerJoinMsg:
		return p.conn.Notify(p.ctx, proto.ClientOnJoin, v)
	case *proto.IslbPeerLeaveMsg:
		return p.conn.Notify(p.ctx, proto.ClientOnLeave, v)
	case *proto.IslbBroadcastMsg:
		return p.conn.Notify(p.ctx, proto.ClientBroadcast, v)
	}
	return errors.New("unknown message")
}
// send message to the peer
send message to the peer
// send message to the peer
func (p *Peer) send(msg interface{}) error {
	switch v := msg.(type) {
	case *proto.ClientOfferMsg:
		return p.conn.Notify(p.ctx, proto.ClientOffer, v.Desc)
	case *proto.ClientTrickleMsg:
		return p.conn.Notify(p.ctx, proto.ClientTrickle, v)
	case *proto.ToClientPeersMsg:
		return p.conn.Notify(p.ctx, proto.ClientOnList, v)
	case *proto.FromIslbStreamAddMsg:
		return p.conn.Notify(p.ctx, proto.ClientOnStreamAdd, v)
	case *proto.ToClientPeerJoinMsg:
		return p.conn.Notify(p.ctx, proto.ClientOnJoin, v)
	case *proto.IslbPeerLeaveMsg:
		return p.conn.Notify(p.ctx, proto.ClientOnLeave, v)
	case *proto.IslbBroadcastMsg:
		return p.conn.Notify(p.ctx, proto.ClientBroadcast, v)
	}
	return errors.New("unknown message")
}
func ( p * Peer ) send ( msg interface { } ) error { switch v := msg . ( type ) { case * proto . ClientOfferMsg : return p . conn . Notify ( p . ctx , proto . ClientOffer , v . Desc ) case * proto . ClientTrickleMsg : return p . conn . Notify ( p . ctx , proto . ClientTrickle , v ) case * proto . ToClientPeersMsg : return p . conn . Notify ( p . ctx , proto . ClientOnList , v ) case * proto . FromIslbStreamAddMsg : return p . conn . Notify ( p . ctx , proto . ClientOnStreamAdd , v ) case * proto . ToClientPeerJoinMsg : return p . conn . Notify ( p . ctx , proto . ClientOnJoin , v ) case * proto . IslbPeerLeaveMsg : return p . conn . Notify ( p . ctx , proto . ClientOnLeave , v ) case * proto . IslbBroadcastMsg : return p . conn . Notify ( p . ctx , proto . ClientBroadcast , v ) } return errors . New ( " " ) }
send message to the peer
send message to the peer