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()
def getAddrFrom(self): addrFrom = self.request.getpeername() return "{0}{1}{2}".format(addrFrom[0], ':', Network.getSocketPort())
def getAddrRecv(self): addrRecv = self.request.getsockname() return "{0}{1}{2}".format(addrRecv[0], ':', Network.getSocketPort())