Add using communication for server
This commit is contained in:
parent
4fba091d4d
commit
b33d5f036c
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user