// the callback from the DS
the callback from the DS
// the callback from the DS
func (p *Protocol) Handler(r io.Reader) error {
	for {
		msg, pkt, err := packet.UnmarshalHandshake(r)
		if err != nil {
			return err
		}
		channel, ok := p.channels[msg.GIK.GroupId]	
		if !ok {
			channel = nil
		}
		if err := GroupChannelHandler(p, channel, msg, pkt); err != nil {
			if err == io.EOF {
				delete(p.channels, msg.GIK.GroupId)
			} else {
				log.Printf("handshake: [%s] handler error, msg = %d: %s", p.self, msg.Type, err)
			}
		}
	}
	return nil
}
func ( p * Protocol ) Handler ( r io . Reader ) error { for { msg , pkt , err := packet . UnmarshalHandshake ( r ) if err != nil { return err } channel , ok := p . channels [ msg . GIK . GroupId ] if ! ok { channel = nil } if err := GroupChannelHandler ( p , channel , msg , pkt ) ; err != nil { if err == io . EOF { delete ( p . channels , msg . GIK . GroupId ) } else { log . Printf ( " " , p . self , msg . Type , err ) } } } return nil }
the callback from the DS
the callback from the DS
// we need to identify the group before verifying the message // continue...