Ocean/System/Start.go
Thorsten Sommer f33f7b5c29 Refactoring, Bugfix & Updates
+ Refactored all imports
+ Fixed a bug for the logging regarding removing \n \t \r
+ Updated to current MGO release
+ Changed the name of ICCC
2014-10-19 19:19:11 +02:00

23 lines
743 B
Go

package System
import (
"github.com/SommerEngineering/Ocean/ICCC"
"github.com/SommerEngineering/Ocean/Log"
LM "github.com/SommerEngineering/Ocean/Log/Meta"
"github.com/SommerEngineering/Ocean/Tools"
"net/http"
)
func StartAndBlockForever() {
ipAddressPort := Tools.LocalIPAddressAndPort()
// Tell the whole cluster, that we are up and ready:
data := ICCCStartUpMessage{}
data.IPAddressAndPort = ipAddressPort
ICCC.WriteMessage2All(ICCC.ChannelSYSTEM, `System::Start`, data)
// Start and block:
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `Web server is now listening.`, `Configuration for hostname and port.`, ipAddressPort)
http.ListenAndServe(ipAddressPort, nil)
}