You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							39 lines
						
					
					
						
							866 B
						
					
					
				
			
		
		
	
	
							39 lines
						
					
					
						
							866 B
						
					
					
				# distutils: language = c++
 | 
						|
#cython: language_level=3
 | 
						|
 | 
						|
from libcpp.string cimport string
 | 
						|
from libcpp.vector cimport vector
 | 
						|
from libcpp cimport bool
 | 
						|
 | 
						|
 | 
						|
cdef extern from "messaging.hpp":
 | 
						|
  cdef cppclass Context:
 | 
						|
    @staticmethod
 | 
						|
    Context * create()
 | 
						|
 | 
						|
  cdef cppclass Message:
 | 
						|
    void init(size_t)
 | 
						|
    void init(char *, size_t)
 | 
						|
    void close()
 | 
						|
    size_t getSize()
 | 
						|
    char *getData()
 | 
						|
 | 
						|
  cdef cppclass SubSocket:
 | 
						|
    @staticmethod
 | 
						|
    SubSocket * create()
 | 
						|
    int connect(Context *, string, string, bool)
 | 
						|
    Message * receive(bool)
 | 
						|
    void setTimeout(int)
 | 
						|
 | 
						|
  cdef cppclass PubSocket:
 | 
						|
    @staticmethod
 | 
						|
    PubSocket * create()
 | 
						|
    int connect(Context *, string)
 | 
						|
    int sendMessage(Message *)
 | 
						|
    int send(char *, size_t)
 | 
						|
 | 
						|
  cdef cppclass Poller:
 | 
						|
    @staticmethod
 | 
						|
    Poller * create()
 | 
						|
    void registerSocket(SubSocket *)
 | 
						|
    vector[SubSocket*] poll(int) nogil
 | 
						|
 |