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