package main
import (
"net"
"go.lindenii.runxiyu.org/lindenii-common/clog"
)
const VERSION = "MeseIRCd-0.0.0"
func main() {
// TODO: Parse config and add TLS
self = &server_t{
conn: nil,
sid: 0,
name: "irc.runxiyu.org",
}
listener, err := net.Listen("tcp", ":6667")
if err != nil {
clog.Fatal(1, "listen", "error", err)
}
defer listener.Close()
for {
conn, err := listener.Accept()
if err != nil {
clog.Fatal(1, "accept", "error", err)
}
go func() {
defer conn.Close()
client, err := new_local_client(&conn)
if err != nil {
clog.Error("new_local_client", "error", err, "conn", &conn)
}
defer client.teardown()
client.handle_connection()
}()
}
}