SAMPHubProxy¶
-
class
astropy.samp.
SAMPHubProxy
[source]¶ Bases:
object
Proxy class to simplify the client interaction with a SAMP hub (via the standard profile).
Attributes Summary
Whether the hub proxy is currently connected to a hub.
Methods Summary
call
(self, private_key, recipient_id, …)Proxy to
call
SAMP Hub method.call_all
(self, private_key, msg_tag, message)Proxy to
callAll
SAMP Hub method.call_and_wait
(self, private_key, …)Proxy to
callAndWait
SAMP Hub method.connect
(self[, hub, hub_params, pool_size])Connect to the current SAMP Hub.
declare_metadata
(self, private_key, metadata)Proxy to
declareMetadata
SAMP Hub method.declare_subscriptions
(self, private_key, …)Proxy to
declareSubscriptions
SAMP Hub method.disconnect
(self)Disconnect from the current SAMP Hub.
get_metadata
(self, private_key, client_id)Proxy to
getMetadata
SAMP Hub method.get_registered_clients
(self, private_key)Proxy to
getRegisteredClients
SAMP Hub method.get_subscribed_clients
(self, private_key, mtype)Proxy to
getSubscribedClients
SAMP Hub method.get_subscriptions
(self, private_key, client_id)Proxy to
getSubscriptions
SAMP Hub method.notify
(self, private_key, recipient_id, message)Proxy to
notify
SAMP Hub method.notify_all
(self, private_key, message)Proxy to
notifyAll
SAMP Hub method.ping
(self)Proxy to
ping
SAMP Hub method (Standard Profile only).register
(self, secret)Proxy to
register
SAMP Hub method.reply
(self, private_key, msg_id, response)Proxy to
reply
SAMP Hub method.server_close
(self)set_xmlrpc_callback
(self, private_key, …)Proxy to
setXmlrpcCallback
SAMP Hub method (Standard Profile only).unregister
(self, 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_and_wait
(self, private_key, recipient_id, message, timeout)[source]¶ Proxy to
callAndWait
SAMP Hub method.
-
connect
(self, hub=None, hub_params=None, pool_size=20)[source]¶ Connect to the current SAMP Hub.
- Parameters
- hub
SAMPHubServer
, optional The hub to connect to.
- hub_paramsdict, 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_sizeint, optional
The number of socket connections opened to communicate with the Hub.
- hub
-
declare_subscriptions
(self, private_key, subscriptions)[source]¶ Proxy to
declareSubscriptions
SAMP Hub method.
-
get_subscribed_clients
(self, private_key, mtype)[source]¶ Proxy to
getSubscribedClients
SAMP Hub method.
-