Ejemplo n.º 1
0
def new(type, filename=None, line_nbr=None):
    if filename is None:
        frame = inspect.stack()[1][0]
        info = inspect.getframeinfo(frame)
        filename = info.filename
        line_nbr = info.lineno
    return ffi.gc(C.zsock_new(type, filename, line_nbr), destroy)
Ejemplo n.º 2
0
def new(ctx, typ):
    """
    Create a new socket within our CZMQ context, replaces zmq_socket.
    Use this to get automatic management of the socket at shutdown.
    Note: SUB sockets do not automatically subscribe to everything;
    you must set filters explicitly.
    """
    return ffi.gc(C.zsocket_new(ctx, typ), lambda s: destroy(ctx, s))
Ejemplo n.º 3
0
def new(ctx, typ):
    """
    Create a new socket within our CZMQ context, replaces zmq_socket.
    Use this to get automatic management of the socket at shutdown.
    Note: SUB sockets do not automatically subscribe to everything;
    you must set filters explicitly.
    """
    return ffi.gc(C.zsocket_new(ctx, typ), lambda s: destroy(ctx, s))
Ejemplo n.º 4
0
def new(ctx):
    """
    Install authentication for the specified context. Returns a new
    zauth object that you can use to configure authentication. Note
    that until you add policies, all incoming NULL connections are
    allowed (classic ZeroMQ behaviour), and all PLAIN and CURVE
    connections are denied. If there was an error during
    initialization, returns NULL.
    """
    return ffi.gc(zauth_new(ctx), destroy)
Ejemplo n.º 5
0
def new(ctx):
    """
    Install authentication for the specified context. Returns a new
    zauth object that you can use to configure authentication. Note
    that until you add policies, all incoming NULL connections are
    allowed (classic ZeroMQ behaviour), and all PLAIN and CURVE
    connections are denied. If there was an error during
    initialization, returns NULL.
    """
    return ffi.gc(C.zauth_new(ctx), destroy)
Ejemplo n.º 6
0
def new(location):
    """
    Create a new certificate store from a disk directory, loading and 
    indexing all certificates in that location. The directory itself may be
    absent, and created later, or modified at any time. The certificate store 
    is automatically refreshed on any zcertstore_lookup() call. If the 
    location is specified as NULL, creates a pure-memory store, which you 
    can work with by inserting certificates at runtime. The location is
    treated as a printf format.
    """
    return ffi.gc(C.zcertstore_new(location), destroy)
Ejemplo n.º 7
0
def new(location):
    """
    Create a new certificate store from a disk directory, loading and
    indexing all certificates in that location. The directory itself may be
    absent, and created later, or modified at any time. The certificate store
    is automatically refreshed on any zcertstore_lookup() call. If the
    location is specified as NULL, creates a pure-memory store, which you
    can work with by inserting certificates at runtime. The location is
    treated as a printf format.
    """
    return ffi.gc(C.zcertstore_new(location), destroy)
Ejemplo n.º 8
0
def new(task, args):
    """Create a new actor passing arbitrary arguments reference."""
    return ffi.gc(C.zactor_new(task, ffi.new_handle(args)), destroy)
Ejemplo n.º 9
0
def new(ctx, port):
    """Create a new beacon on a certain UDP port
    """
    return ffi.gc(C.zbeacon_new(ctx, port), destroy)
Ejemplo n.º 10
0
def new():
    """
    Create new context.
    """
    return ffi.gc(C.zctx_new(), destroy)
Ejemplo n.º 11
0
def new():
    """Create a new zloop reactor"""
    return ffi.gc(C.zloop_new(), destroy)
Ejemplo n.º 12
0
def new_from(public_key, secret_key):
    """Constructor, accepts public/secret key pair from caller
    """
    return ffi.gc(C.zcert_new_from(public_key, secret_key), destroy)
Ejemplo n.º 13
0
def new():
    """Create and initialize a new certificate in memory
    """
    return ffi.gc(C.zcert_new(), destroy)
Ejemplo n.º 14
0
def new():
    """
    Create new context.
    """
    return ffi.gc(C.zctx_new(), destroy)
Ejemplo n.º 15
0
def new(reader, *readers):
    """Create new poller"""
    return ffi.gc(C.zpoller_new(reader, *readers), destroy)
Ejemplo n.º 16
0
def new(reader, *readers):
    """Create new poller"""
    readers = list(readers) + [ffi.NULL]
    return ffi.gc(C.zpoller_new(reader, *readers), destroy)