Golang 002: Nonstop Go socket server talking with iOS, macOS, Android and Java clients

Опубликовано: 17 Октябрь 2024
на канале: Golden Thumb
170
3

package main

import (
"fmt"
"io"
"net"
)

func main() {
listener, _ := net.Listen("tcp", ":50000")
for {
conn, _ := listener.Accept()
fmt.Printf("%s --- %s\n", conn.LocalAddr(), conn.RemoteAddr())
io.WriteString(conn, `0,0,3,3`+"\n")
}
}

GitHub repos of socket client:
https://github.com/zhijunsheng/chess-...
https://github.com/zhijunsheng/chess-...
https://github.com/zhijunsheng/chess-...
https://github.com/zhijunsheng/chess-mac