func (this *CallBack) MessageCome(c *ymtcp.Conn, bytes []byte) error { addr := c.GetConnRemoteAddr() log.Printf("message come from:[%s] [%s]\n", addr.String(), string(bytes)) buff, err := ymtcp.MakePacket(bytes) if err != nil { return err } c.WriteBytesToChan(buff) return nil }
func (this *CallBack) CloseCome(c *ymtcp.Conn) { addr := c.GetConnRemoteAddr() log.Println("conntion close:", addr.String()) }
func (this *CallBack) ConnectCome(c *ymtcp.Conn) bool { addr := c.GetConnRemoteAddr() fmt.Println("connection come:", addr.String()) return true }