CSI-ES-2324/Projs/PD1/internal/server/server.go
2024-04-16 12:23:00 +01:00

30 lines
557 B
Go

package server
import (
_ "PD1/internal/utils/cryptoUtils"
_ "PD1/internal/utils/networking"
"fmt"
"net"
)
func clientHandler(conn net.Conn) {
}
func Run(port int) {
ip, err := net.ResolveTCPAddr("tcp", ":8080")
if err != nil {
panic("Server could not bind to address")
}
listener, err := net.ListenTCP("tcp", ip)
if err != nil {
panic("Server could not listen on address")
}
for {
conn, err := listener.Accept()
if err!=nil{
panic("Server could not accept connection")
}
go clientHandler(conn)
}
}