Beispiel #1
0
def bind(sock, endpoint):
    """ Bind a socket to a formatted endpoint. If the port is specified as '*'
    and the endpoint starts with "tcp://", binds to an ephemeral TCP port in
    a high range. Always returns the port number on successful TCP binds, else
    returns zero on success. Returns -1 on failure. When using ephemeral ports,
    note that ports may be reused by different threads, without clients being
    aware."""
    return C.zsock_bind(sock, endpoint)