uncomment

This commit is contained in:
Niccolo Borgioli 2024-05-24 22:46:34 +02:00
parent c96ead9f16
commit 36ab88d947
No known key found for this signature in database
GPG Key ID: 4897ACD13A65977C

View File

@ -3,8 +3,8 @@ package main
import (
"fmt"
// Uncomment this block to pass the first stage
// "net"
// "os"
"net"
"os"
)
func main() {
@ -13,15 +13,15 @@ func main() {
// Uncomment this block to pass the first stage
//
// l, err := net.Listen("tcp", "0.0.0.0:4221")
// if err != nil {
// fmt.Println("Failed to bind to port 4221")
// os.Exit(1)
// }
//
// _, err = l.Accept()
// if err != nil {
// fmt.Println("Error accepting connection: ", err.Error())
// os.Exit(1)
// }
l, err := net.Listen("tcp", "0.0.0.0:4221")
if err != nil {
fmt.Println("Failed to bind to port 4221")
os.Exit(1)
}
_, err = l.Accept()
if err != nil {
fmt.Println("Error accepting connection: ", err.Error())
os.Exit(1)
}
}