コード例 #1
0
ファイル: _zyre_ctypes.py プロジェクト: horion/zyre
    def recv(self):
        """
        Receive next message from network; the message may be a control
message (ENTER, EXIT, JOIN, LEAVE) or data (WHISPER, SHOUT).
Returns zmsg_t object, or NULL if interrupted
        """
        return czmq.Zmsg(lib.zyre_recv(self._as_parameter_), True)
コード例 #2
0
ファイル: _zyre_ctypes.py プロジェクト: horion/zyre
    def get_msg(self):
        """
        Returns the incoming message payload, and pass ownership to the
caller. The caller must destroy the message when finished with it.
After called on the given event, further calls will return NULL.
        """
        return czmq.Zmsg(lib.zyre_event_get_msg(self._as_parameter_), True)
コード例 #3
0
    def encode(xrap_msg_p):
        """
        Encode xrap_msg into zmsg and destroy it. Returns a newly created
object or NULL if error. Use when not in control of sending the message.
        """
        return czmq.Zmsg(
            lib.xrap_msg_encode(byref(xrap_msg_p.from_param(xrap_msg_p))),
            False)
コード例 #4
0
ファイル: _zyre_ctypes.py プロジェクト: horion/zyre
    def msg(self):
        """
        Returns the incoming message payload; the caller can modify the
message but does not own it and should not destroy it.
        """
        return czmq.Zmsg(lib.zyre_event_msg(self._as_parameter_), False)
コード例 #5
0
 def content(self):
     """
     Return last received content
     """
     return czmq.Zmsg(lib.mlm_client_content(self._as_parameter_), False)
コード例 #6
0
 def recv(self):
     """
     Receive message from server; caller destroys message when done
     """
     return czmq.Zmsg(lib.mlm_client_recv(self._as_parameter_), False)
コード例 #7
0
 def get_content(self):
     """
     Get the content field and transfer ownership to caller
     """
     return czmq.Zmsg(lib.mlm_proto_get_content(self._as_parameter_), False)
コード例 #8
0
 def content(self):
     """
     Get a copy of the content field
     """
     return czmq.Zmsg(lib.mlm_proto_content(self._as_parameter_), False)
コード例 #9
0
ファイル: zyre.py プロジェクト: sara62/zyre
 def msg(self):
     """Returns the incoming message payload (currently one frame)"""
     return czmq.Zmsg(lib.zyre_event_msg(self._as_parameter_), False)
コード例 #10
0
def _list_to_zmsg(parts):
    assert isinstance(parts, (list, tuple))
    zmsg = czmq.Zmsg()
    for p in parts:
        zmsg.addstr(p)
    return zmsg
コード例 #11
0
 def content(self):
     """
     Get a copy of the content field
     """
     return czmq.Zmsg(lib.xrap_traffic_content(self._as_parameter_), False)