Beispiel #1
0
 def fillinGenericRequest(self):
     self.__pboreq.greq.servicename = self.serviceName
     self.__pboreq.greq.caller = 'Distarkcli'
     self.__pboreq.greq.ipadress = NetInfo.getIPString()
Beispiel #2
0
from distark.commons.protos.generic_service_pb2 import PBOneRequest, PBOneResponse
from distark.commons.protos.generic_service_pb2 import SIMPLE_REQUEST
from distark.commons.protos.generic_service_pb2 import SIMPLE_RESPONSE
from distark.commons.protos.generic_service_pb2 import ERROR_NONE
from distark.commons.protos.generic_service_pb2 import ERROR_PARSING_EXCEPTION
from distark.commons.protos.generic_service_pb2 import ERROR_INVALID_ENVELOP
from distark.commons.protos.generic_service_pb2 import ERROR_UNKNOWN_SERVICE
from distark.commons.protos.generic_service_pb2 import ERROR_UNSUPPORTED_SERVICE
from distark.commons.protos.generic_service_pb2 import TECHNICAL_ERROR_RESPONSE
from distark.commons.protos.generic_service_pb2 import PRIORITY_STD


from distark.commons.utils.NetInfo import NetInfo


my_ip = NetInfo.getIPString()
NB_REQUEST = 100000

# TODO: create a handler in separate file for each request/reply pair
# TODO: the handler should take care of transport and
# serialisation/deserialisation to be used as an API

# OUT: PBOneRequest


def simple_request(youpla):

    # instanciate a SimpleRequest
    oreq = PBOneRequest()
    oreq.simplereq.youpla = youpla