- def make_function(self, msg, i, multipart, async):
- if (async):
+ def make_function(self, msg, i, multipart, do_async):
+ if (do_async):
self.id_names = [None] * (self.vpp_dictionary_maxid + 1)
self.id_msgdef = [None] * (self.vpp_dictionary_maxid + 1)
self._api = VppApiDynamicMethodHolder()
self.id_names = [None] * (self.vpp_dictionary_maxid + 1)
self.id_msgdef = [None] * (self.vpp_dictionary_maxid + 1)
self._api = VppApiDynamicMethodHolder()
- f = self.make_function(msg, i, multipart, async)
+ f = self.make_function(msg, i, multipart, do_async)
return msg
def connect_internal(self, name, msg_handler, chroot_prefix, rx_qlen,
return msg
def connect_internal(self, name, msg_handler, chroot_prefix, rx_qlen,
pfx = chroot_prefix.encode() if chroot_prefix else ffi.NULL
rv = vpp_api.vac_connect(name.encode(), pfx, msg_handler, rx_qlen)
if rv != 0:
raise IOError(2, 'Connect failed')
self.connected = True
self.vpp_dictionary_maxid = vpp_api.vac_msg_table_max_index()
pfx = chroot_prefix.encode() if chroot_prefix else ffi.NULL
rv = vpp_api.vac_connect(name.encode(), pfx, msg_handler, rx_qlen)
if rv != 0:
raise IOError(2, 'Connect failed')
self.connected = True
self.vpp_dictionary_maxid = vpp_api.vac_msg_table_max_index()
- def connect(self, name, chroot_prefix=None, async=False, rx_qlen=32):
+ def connect(self, name, chroot_prefix=None, do_async=False, rx_qlen=32):
"""Attach to VPP.
name - the name of the client.
chroot_prefix - if VPP is chroot'ed, the prefix of the jail
"""Attach to VPP.
name - the name of the client.
chroot_prefix - if VPP is chroot'ed, the prefix of the jail
return self.connect_internal(name, msg_handler, chroot_prefix, rx_qlen,
return self.connect_internal(name, msg_handler, chroot_prefix, rx_qlen,
def connect_sync(self, name, chroot_prefix=None, rx_qlen=32):
"""Attach to VPP in synchronous mode. Application must poll for events.
def connect_sync(self, name, chroot_prefix=None, rx_qlen=32):
"""Attach to VPP in synchronous mode. Application must poll for events.
"""
return self.connect_internal(name, ffi.NULL, chroot_prefix, rx_qlen,
"""
return self.connect_internal(name, ffi.NULL, chroot_prefix, rx_qlen,