Skip to content

Commit 0743304

Browse files
committed
Update log
1 parent e17217f commit 0743304

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

handler/server.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ func ServeForever() {
1919
os.Exit(1)
2020
}
2121
defer listener.Close()
22-
fmt.Printf("Server listening on port %d. \nWaiting for connections...\n", common.ServerConfig.Port)
22+
fmt.Printf("Server listening on port %d, waiting for connections...\n", common.ServerConfig.Port)
2323
for {
2424
conn, err := listener.Accept()
2525
if err != nil {
2626
println(err.Error())
2727
continue
2828
}
29-
fmt.Println("Client connection established:", conn.RemoteAddr().String())
3029
go handleClientConnection(conn)
3130
}
3231
}
@@ -62,7 +61,7 @@ func handleHelloPacket(conn net.Conn, buf []byte) {
6261
return
6362
}
6463
defer listener.Close()
65-
fmt.Printf("Forwarding port %d. \n[%d] Waiting for connections...\n", port, port)
64+
fmt.Printf("New client connected, forwarding port %d.\n", port)
6665
for {
6766
userConn, err := listener.Accept()
6867
if err != nil {
@@ -74,7 +73,7 @@ func handleHelloPacket(conn net.Conn, buf []byte) {
7473
store.add(token, &userConn)
7574
err = SendConnPacket(conn, token)
7675
if err != nil {
77-
fmt.Println("Failed to send connection packet: ", err.Error())
76+
fmt.Printf("[%d] Failed to send connection packet: %s\n", port, err.Error())
7877
return
7978
}
8079
}

0 commit comments

Comments
 (0)