func (h *exEventHandler) OnMessage(conn *thing.UserConn, mp *thing.DefaultMessagePacket) (context.Context, thing.PostAction) {
	payload := mp.Payload

	count++

	if payload != nil {
		// do dispatch or ...
		fmt.Println("OnMessage:", string(mp.Payload), count)
		return conn.Context(), thing.PostActionNone
	} else {
		// this will call 'OnErrorPrint'
		thing.GetLandfill(conn.Context()) <- thing.NewFatError(errors.New("err!"), thing.ErrorActionPrint, conn)
	}

	return conn.Context(), thing.PostActionNone
}
// called a packet received except first that
called a packet received except first that
// called a packet received except first that
func (h *exEventHandler) OnMessage(conn *thing.UserConn, mp *thing.DefaultMessagePacket) (context.Context, thing.PostAction) {
	payload := mp.Payload
	count++
	if payload != nil {
		fmt.Println("OnMessage:", string(mp.Payload), count)
		return conn.Context(), thing.PostActionNone
	} else {
		thing.GetLandfill(conn.Context()) <- thing.NewFatError(errors.New("err!"), thing.ErrorActionPrint, conn)
	}
	return conn.Context(), thing.PostActionNone
}
func ( h * exEventHandler ) OnMessage ( conn * thing . UserConn , mp * thing . DefaultMessagePacket ) ( context . Context , thing . PostAction ) { payload := mp . Payload count ++ if payload != nil { fmt . Println ( " " , string ( mp . Payload ) , count ) return conn . Context ( ) , thing . PostActionNone } else { thing . GetLandfill ( conn . Context ( ) ) <- thing . NewFatError ( errors . New ( " " ) , thing . ErrorActionPrint , conn ) } return conn . Context ( ) , thing . PostActionNone }
called a packet received except first that
called a packet received except first that
// do dispatch or ... // this will call 'OnErrorPrint'