Add using communication for server

This commit is contained in:
qowevisa 2024-05-01 17:20:53 +03:00
parent 4fba091d4d
commit b33d5f036c

View File

@ -8,6 +8,7 @@ import (
"log" "log"
"net" "net"
"git.qowevisa.me/Qowevisa/gotell/communication"
"git.qowevisa.me/Qowevisa/gotell/env" "git.qowevisa.me/Qowevisa/gotell/env"
) )
@ -52,6 +53,12 @@ func main() {
func handleClient(conn net.Conn) { func handleClient(conn net.Conn) {
defer conn.Close() defer conn.Close()
buf := make([]byte, 512) buf := make([]byte, 512)
ask, err := communication.AskClientNickname()
if err != nil {
log.Printf("ERROR: %#v\n", err)
} else {
conn.Write(ask)
}
for { for {
log.Print("server: conn: waiting") log.Print("server: conn: waiting")
n, err := conn.Read(buf) n, err := conn.Read(buf)