You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
586 B

  1. package zrouter
  2. import (
  3. "github.com/aceld/zinx/ziface"
  4. "github.com/aceld/zinx/zlog"
  5. "github.com/aceld/zinx/znet"
  6. )
  7. type HelloZinxRouter struct {
  8. znet.BaseRouter
  9. }
  10. //HelloZinxRouter Handle
  11. func (this *HelloZinxRouter) Handle(request ziface.IRequest) {
  12. zlog.Debug("Call HelloZinxRouter Handle")
  13. //先读取客户端的数据,再回写ping...ping...ping
  14. zlog.Debug("recv from client : msgId=", request.GetMsgID(), ", data=", string(request.GetData()))
  15. err := request.GetConnection().SendBuffMsg(1, []byte("Hello Zinx Router V0.10"))
  16. if err != nil {
  17. zlog.Error(err)
  18. }
  19. }