
    h.                     R    S r SSKrSSKJr  SSKJr  S r " S S\\5      r\rSS	/r	g)
z0MQ Frame pure Python methods.    N)Frame   )AttributeSetterc                     [         R                  R                  X5        [         R                  (       d  [	        SU 35      eg )Nz6libzmq and pyzmq must be built with draft support for )zmqerror_check_version	DRAFT_APIRuntimeError)vfeatures     bC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\zmq/sugar/frame.py_draftr      s7    IIQ(==DWIN
 	
     c                       \ rS rSrSrS rS r\S 5       r\R                  S 5       r\S 5       r
\
R                  S 5       r
S	rg
)r      a  
A zmq message Frame class for non-copying send/recvs and access to message properties.

A ``zmq.Frame`` wraps an underlying ``zmq_msg_t``.

Message *properties* can be accessed by treating a Frame like a dictionary (``frame["User-Id"]``).

.. versionadded:: 14.4, libzmq 4

    Frames created by ``recv(copy=False)`` can be used to access message properties and attributes,
    such as the CURVE User-Id.

    For example::

        frames = socket.recv_multipart(copy=False)
        user_id = frames[0]["User-Id"]

This class is used if you want to do non-copying send and recvs.
When you pass a chunk of bytes to this class, e.g. ``Frame(buf)``, the
ref-count of `buf` is increased by two: once because the Frame saves `buf` as
an instance attribute and another because a ZMQ message is created that
points to the buffer of `buf`. This second ref-count increase makes sure
that `buf` lives until all messages that use it have been sent.
Once 0MQ sends all the messages and it doesn't need the buffer of ``buf``,
0MQ will call ``Py_DECREF(s)``.

Parameters
----------

data : object, optional
    any object that provides the buffer interface will be used to
    construct the 0MQ message data.
track : bool
    whether a MessageTracker_ should be created to track this object.
    Tracking a message has a cost at creation, because it creates a threadsafe
    Event object.
copy : bool
    default: use copy_threshold
    Whether to create a copy of the data to pass to libzmq
    or share the memory with libzmq.
    If unspecified, copy_threshold is used.
copy_threshold: int
    default: :const:`zmq.COPY_THRESHOLD`
    If copy is unspecified, messages smaller than this many bytes
    will be copied and messages larger than this will be shared with libzmq.
c                 $    U R                  U5      $ )N)get)selfkeys     r   __getitem__Frame.__getitem__D   s    xx}r   c                 r   [        U 5      nSnUS:  aX  [        [        U R                  5      SS 5      nUS:  a  SnUS-  nO US:  a  SnUS	-  nOUS
:  a  SnUS
-  nOSnUnSUS U 3nOU R                  nU R                  R
                  nUS:X  a  SnSU SU R                  R                   SU< U S3$ )z#Return the str form of the message.    N   g    eAGBi   MBg    .Ag     @@kBBz...z.0fzzmq.sugar.framer   <.(z)>)lenbytes
memoryviewbuffer	__class__
__module____name__)r   nbytes
msg_suffix	msg_bytesunitn_modules          r   __repr__Frame.__repr__H   s    T
B;j5cr:;I}cM5cM3cMqgdV,J

I..++''G7)1T^^445QymJ<rRRr   c                 <    [        SS5        U R                  S5      $ )z|The RADIO-DISH group of the message.

Requires libzmq >= 4.2 and pyzmq built with draft APIs enabled.

.. versionadded:: 17
      
RADIO-DISHgroupr   r   r   s    r   r8   Frame.groupc   s     	v|$xx  r   c                 @    [        SS5        U R                  SU5        g )Nr4   r7   r8   r   set)r   r8   s     r   r8   r;   n   s    v|$% r   c                 <    [        SS5        U R                  S5      $ )zThe CLIENT-SERVER routing id of the message.

Requires libzmq >= 4.2 and pyzmq built with draft APIs enabled.

.. versionadded:: 17
r4   CLIENT-SERVER
routing_idr9   r:   s    r   rA   Frame.routing_ids   s     	v'xx%%r   c                 @    [        SS5        U R                  SU5        g )Nr4   r@   rA   r=   )r   rA   s     r   rA   rB   ~   s    v'z*r    N)r*   r)   __qualname____firstlineno____doc__r   r1   propertyr8   setterrA   __static_attributes__rD   r   r   r   r      sm    -^S6 ! ! \\! ! & & + +r   r   Message)
rG   r   zmq.backendr   	FrameBase	attrsettrr   r   rK   __all__rD   r   r   <module>rP      s:    $
  * &
m+I m+b I
r   