Пример #1
0
    def _realStart(self, gateConfig):
        import sys
        modkeys = sys.modules.keys()
        i = 1

        from playground import playgroundlog
        from playground.network.gate import Service
        #from playground.twisted.error.ErrorHandlers import TwistedShutdownErrorHandler
        from twisted.internet import reactor
        from playground.twisted.error.ErrorHandlers import TwistedShutdownErrorHandler
        #logctx = playgroundlog.LoggingContext("GATE_%s" % gateConfig.playgroundAddr)

        # Uncomment the next line to turn on "packet tracing"
        #logctx.doPacketTracing = True

        #playgroundlog.startLogging(logctx)
        #playgroundlog.UseStdErrHandler(True)

        TwistedShutdownErrorHandler.HandleRootFatalErrors()
        Service.Create(reactor, gateConfig)
        print "start gate", gateConfig.playgroundAddr
        reactor.run()
        print 'stop gate'
Пример #2
0
'''
Created on Sep 10, 2016

@author: sethjn
'''

from playground import playgroundlog
from playground.network.gate import Service, ConnectionData
from playground.twisted.error.ErrorHandlers import TwistedShutdownErrorHandler
from twisted.internet import reactor
import sys

if __name__ == "__main__":
    gateConfig = len(sys.argv) == 2 and sys.argv[1] or None
    g2gConnect = ConnectionData.CreateFromConfig(gateConfig)
    logctx = playgroundlog.LoggingContext("GATE_%s" %
                                          g2gConnect.playgroundAddr)

    # Uncomment the next line to turn on "packet tracing"
    #logctx.doPacketTracing = True

    playgroundlog.startLogging(logctx)
    playgroundlog.UseStdErrHandler(True)
    TwistedShutdownErrorHandler.HandleRootFatalErrors()
    Service.Create(reactor, gateConfig)
    reactor.run()
Пример #3
0
def run(details):
    controller = Controller()
    controller.connectToChaperone(details)
    TwistedShutdownErrorHandler.HandleRootFatalErrors()
    reactor.run()