aboutsummaryrefslogtreecommitdiff
path: root/cmd/vhost
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/vhost')
-rw-r--r--cmd/vhost/main.go16
1 files changed, 7 insertions, 9 deletions
diff --git a/cmd/vhost/main.go b/cmd/vhost/main.go
index 7c32df8..6a78b97 100644
--- a/cmd/vhost/main.go
+++ b/cmd/vhost/main.go
@@ -7,8 +7,8 @@ import (
// "iptcp/pkg/tcpstack"
"net/netip"
"os"
- "strings"
"strconv"
+ "strings"
)
func main() {
@@ -85,7 +85,7 @@ func main() {
}
}
}
-// ********************************************TCP REPL***************************************************************
+ // ********************************************TCP REPL***************************************************************
case "a":
// accept a connection
// get the port number
@@ -102,14 +102,12 @@ func main() {
continue
}
go func() {
- for {
- conn, err := listener.VAccept()
- if err != nil {
- fmt.Println(err)
- }
- sockets[conn.Socket] = conn
+ conn, err := listener.VAccept()
+ if err != nil {
+ fmt.Println(err)
}
- }()
+ sockets[conn.Socket] = conn
+ }()
case "c":
if len(tokens) != 3 {
fmt.Println("Invalid command: ", line)