Exemple #1
0
def main():
    # Parse command line arguments
    args = parseCommandLine()

    # Start logging
    log.start(args.foreground, args.logfile)
    log.info("Starting up")

    # Read server configuration from config file
    config = Configuration()
    log.info("Reading configuration from {config}", config=args.config)
    if not config.parseConfig(args.config):
        log.error("Exiting")
        exit(1)

    # Create and start the netserver
    server = NetServer(config)
    server.start()
Exemple #2
0
#coding:utf8

import os
if os.name != 'nt' and os.name != 'posix':
    from twisted.internet import epollreactor
    epollreactor.install()

import json
from netserver import NetServer

if __name__ == "__main__":
    servername = 'net'
    config = json.load(open('config.json', 'r'))
    dbconf = config.get('db')
    memconf = config.get('memcached')
    sersconf = config.get('servers', {})
    masterconf = config.get('master', {})
    serconfig = sersconf.get(servername)
    ser = NetServer()
    ser.config(serconfig,
               dbconfig=dbconf,
               memconfig=memconf,
               masterconf=masterconf)
    ser.start()
Exemple #3
0
#coding:utf8

import os
if os.name!='nt' and os.name!='posix':
    from twisted.internet import epollreactor
    epollreactor.install()

import json
from netserver import NetServer

if __name__ == "__main__":
    servername = 'net'
    config = json.load(open('config.json', 'r'))
    dbconf = config.get('db')
    memconf = config.get('memcached')
    sersconf = config.get('servers',{})
    masterconf = config.get('master',{})
    serconfig = sersconf.get(servername)
    ser = NetServer()
    ser.config(serconfig, dbconfig=dbconf, memconfig=memconf,masterconf=masterconf)
    ser.start()