Beispiel #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()
Beispiel #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()
Beispiel #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))
Beispiel #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()
Beispiel #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))
Beispiel #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()
Beispiel #7
0
def shadow_pyzmq_socket(pyzmq_socket):
    """
    Get the underlying socket from a pyzmq Socket
    """
    return ffi.cast("void *", pyzmq_socket.underlying)
Beispiel #8
0
def shadow_pyzmq_socket(pyzmq_socket):
    """
    Get the underlying socket from a pyzmq Socket
    """
    return ffi.cast("void *", pyzmq_socket.underlying)