コード例 #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)