txmsgpackrpc.protocol.MsgpackMulticastDatagramProtocol

Here are the examples of the python api txmsgpackrpc.protocol.MsgpackMulticastDatagramProtocol taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

Example 1

Project: txmsgpackrpc Source File: client.py
def connect_multicast(group, port, ttl=1, waitTimeout=None):
    """
    Connect RPC servers via multicast UDP. Returns C{t.i.d.Deferred} that will
    callback with C{protocol.MsgpackMulticastDatagramProtocol} object.

    @param host: IP address of group to join to.
    @type host: C{str}
    @param port: port number.
    @type port: C{int}
    @param ttl: time to live of multicast packets.
    @type ttl: C{int}
    @param waitTimeout: number of seconds the protocol waits for response.
    @type waitTimeout: C{int}
    @return Deferred that callbacks with
        C{protocol.MsgpackMulticastDatagramProtocol} object or errbacks
        with C{ConnectionError}.
    @rtype C{t.i.d.Deferred}
    """
    protocol = MsgpackMulticastDatagramProtocol(group, ttl, port, timeout=waitTimeout)

    reactor.listenMulticast(0, protocol, listenMultiple=True)

    return defer.succeed(protocol)