| 12 | var session *yamux.Session |
| 13 | |
| 14 | func ClientWait(port string) { |
| 15 | hostClient := "0.0.0.0" |
| 16 | portClient := port |
| 17 | client, err := net.Listen("tcp", fmt.Sprintf("%s:%s", hostClient, portClient)) |
| 18 | if err != nil { |
| 19 | fmt.Println(err, err.Error()) |
| 20 | os.Exit(0) |
| 21 | } |
| 22 | fmt.Println("client list on :7777") |
| 23 | for { |
| 24 | conn, err := client.Accept() |
| 25 | if err != nil { |
| 26 | fmt.Println("clien error") |
| 27 | fmt.Println(err) |
| 28 | continue |
| 29 | } |
| 30 | session, err = yamux.Server(conn, nil) |
| 31 | } |
| 32 | } |
| 33 | func ServerWait(port string) { |
| 34 | hostServer := "0.0.0.0" |
| 35 | portServer := port |