GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — cellnet/sysmsg.go at master · stanjiang/cellnet Expand file tree/ Copy pathsysmsg.goMore file actions 56 lines (43 loc) · 1.47 KB / Copy pathsysmsg.goFile metadata and controls56 lines (43 loc) · 1.47 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 package cellnet import "fmt" type SessionInit struct { } type SessionAccepted struct { } type SessionConnected struct { } type SessionConnectError struct { } type CloseReason int32 const ( CloseReason_IO CloseReason = iota // 普通IO断开 CloseReason_Manual // 关闭前,调用过Session.Close ) func (self CloseReason) String() string { switch self { case CloseReason_IO: return "IO" case CloseReason_Manual: return "Manual" } return "Unknown" } type SessionClosed struct { Reason CloseReason // 断开原因 } // udp通知关闭,内部使用 type SessionCloseNotify struct { } func (self *SessionInit) String() string { return fmt.Sprintf("%+v", *self) } func (self *SessionAccepted) String() string { return fmt.Sprintf("%+v", *self) } func (self *SessionConnected) String() string { return fmt.Sprintf("%+v", *self) } func (self *SessionConnectError) String() string { return fmt.Sprintf("%+v", *self) } func (self *SessionClosed) String() string { return fmt.Sprintf("%+v", *self) } func (self *SessionCloseNotify) String() string { return fmt.Sprintf("%+v", *self) } // 使用类型断言判断是否为系统消息 func (self *SessionInit) SystemMessage() {} func (self *SessionAccepted) SystemMessage() {} func (self *SessionConnected) SystemMessage() {} func (self *SessionConnectError) SystemMessage() {} func (self *SessionClosed) SystemMessage() {} func (self *SessionCloseNotify) SystemMessage() {} |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |