Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 39 lines (31 sloc) 1.114 kb
4478a2af » tonywok
2012-03-12 add git ignore
1 #import <Foundation/Foundation.h>
2 #import "ZMQSocket.h" // ZMQSocketType
3 #import <libkern/OSAtomic.h>
4
5 /* Special polling timeout values. */
6 #define ZMQPollTimeoutNever (-1)
7 #define ZMQPollTimeoutNow (0)
8
9 @interface ZMQContext : NSObject {
10 void *context;
11 NSMutableArray *sockets;
12 OSSpinLock socketsLock;
13 BOOL terminated;
14 }
15 + (void)getZMQVersionMajor:(int *)major minor:(int *)minor patch:(int *)patch;
16
17 /* Polling */
18 // Generic poll interface.
19 + (int)pollWithItems:(zmq_pollitem_t *)ioItems count:(int)itemCount
20 timeoutAfterUsec:(long)usec;
21
22 // Creates a ZMQContext using |threadCount| threads for I/O.
23 - (id)initWithIOThreads:(NSUInteger)threadCount;
24
25 - (ZMQSocket *)socketWithType:(ZMQSocketType)type;
26 // Sockets associated with this context.
27 @property(readonly, retain, NS_NONATOMIC_IPHONEONLY) NSArray *sockets;
28
29 // Closes all associated sockets.
30 - (void)closeSockets;
31
32 // Initiates termination. All associated sockets will be shut down.
33 - (void)terminate;
34
35 // YES if termination has been initiated.
36 // KVOable.
37 @property(readonly, getter=isTerminated, NS_NONATOMIC_IPHONEONLY)
38 BOOL terminated;
39 @end
Something went wrong with that request. Please try again.