Open socket before defer close
This commit is contained in:
@@ -66,6 +66,8 @@ func main() {
|
|||||||
panic(err)
|
panic(err)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ln, _ := net.Listen("tcp", ":8081")
|
||||||
|
|
||||||
//cleanup
|
//cleanup
|
||||||
defer func() {
|
defer func() {
|
||||||
@@ -85,7 +87,7 @@ func main() {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
//accepts command from cmd.go and sends them to the server
|
//accepts command from cmd.go and sends them to the server
|
||||||
ln, _ := net.Listen("tcp", ":8081")
|
|
||||||
go func() {
|
go func() {
|
||||||
//accept connections from clients
|
//accept connections from clients
|
||||||
for {
|
for {
|
||||||
|
Reference in New Issue
Block a user