sysmsg.go 732 B

123456789101112131415161718192021222324252627282930313233343536
  1. package rocommon
  2. import "fmt"
  3. // hooker中使用 上层消息队列通过该消息类型来确定当前是创建了连接
  4. //连接成功事件
  5. type SessionConnected struct {
  6. ConnectedSId string
  7. }
  8. func (this *SessionConnected) String() string {
  9. return fmt.Sprintf("%+v", *this)
  10. }
  11. //连接出错事件
  12. type SessionConnectError struct{}
  13. func (this *SessionConnectError) String() string {
  14. return fmt.Sprintf("%+v", *this)
  15. }
  16. //接收其他服务器/客户端的连接
  17. type SessionAccepted struct{}
  18. func (this *SessionAccepted) String() string {
  19. return fmt.Sprintf("%+v", *this)
  20. }
  21. //session关闭
  22. type SessionClosed struct {
  23. CloseSId string
  24. }
  25. func (this *SessionClosed) String() string {
  26. return fmt.Sprintf("%+v", *this)
  27. }