Exemplo n.º 1
0
 def load(self, filename):
     fd = open(filename, 'r')
     if self.msg:
         self.destroy()
     msg = zmsg.load(ffi.NULL, ffi.cast("FILE *", filename))
     if msg is not ffi.NULL:
         self.msg = msg
     fd.close()
Exemplo n.º 2
0
 def load(self, filename):
     fd = open(filename, 'r')
     if self.msg:
         self.destroy()
     msg = zmsg.load(ffi.NULL, ffi.cast("FILE *", filename))
     if msg is not ffi.NULL:
         self.msg = msg
     fd.close()
Exemplo n.º 3
0
def shadow_pyzmq_ctx(pyzmqctx):
    """
    Create a new context by shadowing a pyzmq context
    """
    address = pyzmqctx.underlying
    return shadow_zmq_ctx(ffi.cast('void *', address))
Exemplo n.º 4
0
 def save(self, filename):
     fd = open(filename, 'w')
     rc = zmsg.save(self.msg, ffi.cast("FILE *", filename))
     if rc != 0:
         print("Error saving msg to file")
     fd.close()
Exemplo n.º 5
0
def shadow_pyzmq_ctx(pyzmqctx):
    """
    Create a new context by shadowing a pyzmq context
    """
    address = pyzmqctx.underlying
    return shadow_zmq_ctx(ffi.cast('void *', address))
Exemplo n.º 6
0
 def save(self, filename):
     fd = open(filename, 'w')
     rc = zmsg.save(self.msg, ffi.cast("FILE *", filename))
     if rc != 0:
         print("Error saving msg to file")
     fd.close()
Exemplo n.º 7
0
def shadow_pyzmq_socket(pyzmq_socket):
    """
    Get the underlying socket from a pyzmq Socket
    """
    return ffi.cast("void *", pyzmq_socket.underlying)
Exemplo n.º 8
0
def shadow_pyzmq_socket(pyzmq_socket):
    """
    Get the underlying socket from a pyzmq Socket
    """
    return ffi.cast("void *", pyzmq_socket.underlying)