()
| 32 | } |
| 33 | |
| 34 | func main() { |
| 35 | // Create a TLS client. |
| 36 | c := znet.NewTLSClient("127.0.0.1", 8899) |
| 37 | |
| 38 | c.SetOnConnStart(func(connection ziface.IConnection) { |
| 39 | go func() { |
| 40 | for { |
| 41 | err := connection.SendMsg(1, []byte("Ping with TLS")) |
| 42 | |
| 43 | if err != nil { |
| 44 | fmt.Println(err) |
| 45 | break |
| 46 | } |
| 47 | |
| 48 | time.Sleep(1 * time.Second) |
| 49 | } |
| 50 | }() |
| 51 | |
| 52 | }) |
| 53 | |
| 54 | c.AddRouter(2, &PongRouter{}) |
| 55 | |
| 56 | c.Start() |
| 57 | |
| 58 | wait() |
| 59 | } |
nothing calls this directly
no test coverage detected