예제 #1
0
def handleArguments(arguments):
    httpPort = Http.getHttpPort()
    socketPort = Network.getSocketPort()

    if arguments.service_port:
        httpPort = arguments.service_port
        Http.setHttpPort(httpPort)
    if arguments.node_port:
        socketPort = arguments.node_port
        Network.setSocketPort(socketPort)

    if Config.getBoolValue("ENABLE_HTTP_SERVICE"):
        httpNode = HttpNode(httpPort)
        httpNode.start()

    UPnP.addPortMapping(socketPort)

    socketNode = SocketNode(socketPort)
    socketNode.sync()
    socketNode.start()
예제 #2
0
 def getAddrFrom(self):
     addrFrom = self.request.getpeername()
     return "{0}{1}{2}".format(addrFrom[0], ':', Network.getSocketPort())
예제 #3
0
 def getAddrRecv(self):
     addrRecv = self.request.getsockname()
     return "{0}{1}{2}".format(addrRecv[0], ':', Network.getSocketPort())