예제 #1
0
파일: types.py 프로젝트: zeromq/pyczmq
 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()
예제 #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()
예제 #3
0
파일: zctx.py 프로젝트: marquisrobb/pyczmq
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))
예제 #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()
예제 #5
0
파일: zctx.py 프로젝트: aburan28/pyczmq
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))
예제 #6
0
파일: types.py 프로젝트: zeromq/pyczmq
 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()
예제 #7
0
파일: zsocket.py 프로젝트: aburan28/pyczmq
def shadow_pyzmq_socket(pyzmq_socket):
    """
    Get the underlying socket from a pyzmq Socket
    """
    return ffi.cast("void *", pyzmq_socket.underlying)
예제 #8
0
def shadow_pyzmq_socket(pyzmq_socket):
    """
    Get the underlying socket from a pyzmq Socket
    """
    return ffi.cast("void *", pyzmq_socket.underlying)