module Daemon

Defined in:

daemon.cr

Constant Summary

CLIENT = (ENV.fetch("MCAST_CLIENT_PORT", "1112")).to_i
CLIENT_SEND_INTERVAL = (ENV.fetch("SHOUT_INTERVAL", "10")).to_i
CLIENT_TTL = (ENV.fetch("CLEAN_INTERVAL", "30")).to_i
CONFIG_PATH = (ENV.fetch("CONFIG_PATH", "/data/techlit/config.json")).to_s
HOST = (ENV.fetch("MCAST_HOST", "224.0.3.111")).to_s
SAVE_INTERVAL = (ENV.fetch("CLEAN_INTERVAL", "10")).to_i
SERVER = (ENV.fetch("MCAST_SERVER_PORT", "1111")).to_i
SERVER_SEND_INTERVAL = (ENV.fetch("SHOUT_INTERVAL", "10")).to_i
VERSION = "0.1.0"

Class Method Summary

Class Method Detail

def self.config #

[View source]
def self.load_config #

[View source]
def self.receive_from(port, &block : String, IP -> ) #

[View source]
def self.run_as_client #

[View source]
def self.run_as_server #

[View source]
def self.save_config #

[View source]
def self.send_as(port, interval, &block : -> String) #

[View source]