TCP servers setup, connection handling and first command (QUIT).

This commit is contained in:
Stanislav Nikitin 2019-09-02 22:08:37 +05:00
parent 46f14be481
commit e1b71e5d44
No known key found for this signature in database
GPG Key ID: 106900B32F8192EE
2 changed files with 11 additions and 0 deletions

View File

@ -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()

View File

@ -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)
}
}