diff options
| author | ilotterytea <iltsu@alright.party> | 2025-08-02 13:15:00 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-08-02 13:15:00 +0500 |
| commit | 830f7a2dfe59bcdc9442275251c892b0b7b32900 (patch) | |
| tree | 074fb57b0e0bf32c465b315cd0644c71c0b3583f /cmd/ircd | |
| parent | 141ea48aef643b2e2f7b7ed6e564365ced7a03b8 (diff) | |
feat: client struct
Diffstat (limited to 'cmd/ircd')
| -rw-r--r-- | cmd/ircd/main.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/ircd/main.go b/cmd/ircd/main.go index 91eebbf..ba958d0 100644 --- a/cmd/ircd/main.go +++ b/cmd/ircd/main.go @@ -8,7 +8,6 @@ import ( ) func main() { - fmt.Println("hello world!") listener, err := net.Listen("tcp", ":6667") if err != nil { log.Fatalf("Error listening: %v", err) @@ -17,6 +16,8 @@ func main() { fmt.Println("IRC server listening on :6667") + clients := []*ircd.Client{} + for { conn, err := listener.Accept() if err != nil { @@ -24,6 +25,10 @@ func main() { continue } - go ircd.HandleClientConnection(conn) + client := ircd.NewIRCClient(conn) + + clients = append(clients, client) + + go client.HandleConnection() } } |
