
    Mhk                     f    d Z ddlmZmZ ddlmZmZmZ ddlm	Z	 ddlm
Z  G d d          ZdgZd	S )
zzmq Context class    )EINVAL
IO_THREADS)InterruptedSystemCallZMQError	_check_rc   )ffi)libc                   d    e Zd ZdZdZdZdZddZed             Z	ed             Z
d Zd	 Zd
 ZdS )ContextNTFr   c                 |   |r"t          j        d|          | _        d| _        n9d| _        |dk    st	          t
                    t          j                    | _        | j        t           j        k    r t	          t          j	                              |s t          j
        | j        t          |           d| _        d S )Nzvoid *TFr   )r	   cast_zmq_ctx_shadowr   r   Czmq_ctx_newNULL	zmq_errnozmq_ctx_setr   _closed)self
io_threadsshadows      X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/zmq/backend/cffi/context.py__init__zContext.__init__   s     	,HXv66DMDLL DL??v&&&MOODM=CH$$1;==))) 	AM$-Z@@@    c                 P    t          t          j        d| j                            S )z,The address of the underlying libzmq contextsize_t)intr	   r   r   r   s    r   
underlyingzContext.underlying#   s      38Hdm44555r   c                     | j         S )N)r   r    s    r   closedzContext.closed(   s
    |r   c                 Z    t          j        | j        ||          }t          |           dS )z6set a context option

        see zmq_ctx_set
        N)r   r   r   r   )r   optionvaluercs       r   setzContext.set,   s(    
 ]4=&%88"r   c                 \    t          j        | j        |          }t          |d           |S )z4get context option

        see zmq_ctx_get
        F)error_without_errno)r   zmq_ctx_getr   r   )r   r%   r'   s      r   getzContext.get4   s/    
 ]4=&11"%0000	r   c                     | j         rd S t          j        | j                  }	 t	          |           n# t
          $ r Y nw xY wd | _        d| _        d S )NT)r#   r   zmq_ctx_destroyr   r   r   r   )r   r'   s     r   termzContext.term=   sk    ; 	Ft}--	bMMMM$ 	 	 	 D	
 s   4 
A A)r   N)__name__
__module____qualname__r   
_iothreadsr   r   r   propertyr!   r#   r(   r,   r/    r   r   r   r      s        HJGG     6 6 X6   X        r   r   N)__doc__zmq.constantsr   r   	zmq.errorr   r   r   _cffir	   r
   r   r   __all__r5   r   r   <module>r;      s     
 - , , , , , , , @ @ @ @ @ @ @ @ @ @            = = = = = = = =@ +r   