package main

import (
	"github.com/gogf/gf/net/gtcp"
)

func main() {
	conn, err := gtcp.NewConn("127.0.0.1:8998")
	if err != nil {
		panic(err)
	}

	for {
		buf, err := conn.RecvTil([]byte{0x16})
		if err != nil {
			return
		}
		if len(buf) > 0 {
			conn.Write([]byte{0x68, 0x76, 0x02, 0x02, 0x47, 0x02, 0x02, 0x68, 0x91, 0x08, 0x33, 0x33, 0x34, 0x33, 0x35, 0x33, 0x33, 0x33, 0xC9, 0x16})
		}
	}
}
