SAMPHubProxy

class astropy.samp.SAMPHubProxy[source] [edit on github]

Bases: object

Proxy class to simplify the client interaction with a SAMP hub (via the standard profile).

Attributes Summary

is_connected Whether the hub proxy is currently connected to a hub.

Methods Summary

call(private_key, recipient_id, msg_tag, message) Proxy to call SAMP Hub method.
call_all(private_key, msg_tag, message) Proxy to callAll SAMP Hub method.
call_and_wait(private_key, recipient_id, …) Proxy to callAndWait SAMP Hub method.
connect([hub, hub_params, pool_size]) Connect to the current SAMP Hub.
declare_metadata(private_key, metadata) Proxy to declareMetadata SAMP Hub method.
declare_subscriptions(private_key, subscriptions) Proxy to declareSubscriptions SAMP Hub method.
disconnect() Disconnect from the current SAMP Hub.
get_metadata(private_key, client_id) Proxy to getMetadata SAMP Hub method.
get_registered_clients(private_key) Proxy to getRegisteredClients SAMP Hub method.
get_subscribed_clients(private_key, mtype) Proxy to getSubscribedClients SAMP Hub method.
get_subscriptions(private_key, client_id) Proxy to getSubscriptions SAMP Hub method.
notify(private_key, recipient_id, message) Proxy to notify SAMP Hub method.
notify_all(private_key, message) Proxy to notifyAll SAMP Hub method.
ping() Proxy to ping SAMP Hub method (Standard Profile only).
register(secret) Proxy to register SAMP Hub method.
reply(private_key, msg_id, response) Proxy to reply SAMP Hub method.
server_close()
set_xmlrpc_callback(private_key, xmlrpc_addr) Proxy to setXmlrpcCallback SAMP Hub method (Standard Profile only).
unregister(private_key) Proxy to unregister SAMP Hub method.

Attributes Documentation

is_connected

Whether the hub proxy is currently connected to a hub.

Methods Documentation

call(private_key, recipient_id, msg_tag, message)[source] [edit on github]

Proxy to call SAMP Hub method.

call_all(private_key, msg_tag, message)[source] [edit on github]

Proxy to callAll SAMP Hub method.

call_and_wait(private_key, recipient_id, message, timeout)[source] [edit on github]

Proxy to callAndWait SAMP Hub method.

connect(hub=None, hub_params=None, pool_size=20)[source] [edit on github]

Connect to the current SAMP Hub.

Parameters:
hub : SAMPHubServer, optional

The hub to connect to.

hub_params : dict, optional

Optional dictionary containing the lock-file content of the Hub with which to connect. This dictionary has the form {<token-name>: <token-string>, ...}.

pool_size : int, optional

The number of socket connections opened to communicate with the Hub.

declare_metadata(private_key, metadata)[source] [edit on github]

Proxy to declareMetadata SAMP Hub method.

declare_subscriptions(private_key, subscriptions)[source] [edit on github]

Proxy to declareSubscriptions SAMP Hub method.

disconnect()[source] [edit on github]

Disconnect from the current SAMP Hub.

get_metadata(private_key, client_id)[source] [edit on github]

Proxy to getMetadata SAMP Hub method.

get_registered_clients(private_key)[source] [edit on github]

Proxy to getRegisteredClients SAMP Hub method.

get_subscribed_clients(private_key, mtype)[source] [edit on github]

Proxy to getSubscribedClients SAMP Hub method.

get_subscriptions(private_key, client_id)[source] [edit on github]

Proxy to getSubscriptions SAMP Hub method.

notify(private_key, recipient_id, message)[source] [edit on github]

Proxy to notify SAMP Hub method.

notify_all(private_key, message)[source] [edit on github]

Proxy to notifyAll SAMP Hub method.

ping()[source] [edit on github]

Proxy to ping SAMP Hub method (Standard Profile only).

register(secret)[source] [edit on github]

Proxy to register SAMP Hub method.

reply(private_key, msg_id, response)[source] [edit on github]

Proxy to reply SAMP Hub method.

server_close()[source] [edit on github]
set_xmlrpc_callback(private_key, xmlrpc_addr)[source] [edit on github]

Proxy to setXmlrpcCallback SAMP Hub method (Standard Profile only).

unregister(private_key)[source] [edit on github]

Proxy to unregister SAMP Hub method.