Added more ICCC commands
+ Added ICCC command for register a host + Added ICCC command for register a command i.e. listener + Added ICCC command for getting a number from NumGen
This commit is contained in:
1 parent
326eb9ba7a
commit
6e111b7517
15 files changed
+244
-65
No files matched your search
@@ -4,17 +4,16 @@ import (
|
||||
"github.com/SommerEngineering/Ocean/ICCC/Scheme"
|
||||
"github.com/SommerEngineering/Ocean/Log"
|
||||
LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
||||
"github.com/SommerEngineering/Ocean/Tools"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
)
|
||||
|
||||
// Function to register this server to the ICCC.
|
||||
func registerHost2Database() {
|
||||
// Function to register a server to the ICCC.
|
||||
func registerHost2Database(hostname, ipAddressPort string) {
|
||||
|
||||
// Create the host entry:
|
||||
host := Scheme.Host{}
|
||||
host.Hostname = Tools.ThisHostname()
|
||||
host.IPAddressPort = correctAddressWithPort
|
||||
host.Hostname = hostname
|
||||
host.IPAddressPort = ipAddressPort
|
||||
|
||||
// The query to find already existing entries:
|
||||
selection := bson.D{{`Hostname`, host.Hostname}, {`IPAddressPort`, host.IPAddressPort}}
|
||||
|
||||
Reference in new issue
Block a user