From e1b71e5d44f553ad57acb348405d50628fb3a922 Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Mon, 2 Sep 2019 22:08:37 +0500 Subject: [PATCH] TCP servers setup, connection handling and first command (QUIT). --- cmd/gonewsd/main.go | 4 ++++ networker/exported.go | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/cmd/gonewsd/main.go b/cmd/gonewsd/main.go index 9c7ce11..2e9f265 100644 --- a/cmd/gonewsd/main.go +++ b/cmd/gonewsd/main.go @@ -8,6 +8,8 @@ import ( "syscall" // local + "develop.pztrn.name/gonews/gonews/commands" + "develop.pztrn.name/gonews/gonews/configuration" "develop.pztrn.name/gonews/gonews/eventer" "develop.pztrn.name/gonews/gonews/networker" ) @@ -15,7 +17,9 @@ import ( func main() { log.Println("Starting gonewsd...") + configuration.Initialize() eventer.Initialize() + commands.Initialize() networker.Initialize() eventer.InitializeCompleted() diff --git a/networker/exported.go b/networker/exported.go index c983460..7b7f7fb 100644 --- a/networker/exported.go +++ b/networker/exported.go @@ -3,9 +3,16 @@ package networker import ( // stdlib "log" + + // local + "develop.pztrn.name/gonews/gonews/configuration" ) // Initialize initializes package. func Initialize() { log.Println("Initializing network connections handler...") + + for _, iface := range configuration.Cfg.Network { + go startServer(iface) + } }