mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 21:28:22 +08:00
23 lines
359 B
Go
23 lines
359 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gogf/gf/g/net/gtcp"
|
|
"github.com/gogf/gf/g/os/glog"
|
|
"github.com/gogf/gf/g/os/gtime"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
conn, err := gtcp.NewConn("127.0.0.1:8999")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
defer conn.Close()
|
|
|
|
if err := conn.Send([]byte(gtime.Now().String())); err != nil {
|
|
glog.Error(err)
|
|
}
|
|
|
|
time.Sleep(time.Minute)
|
|
}
|