Starting and Stopping a SAMP Hub Server¶
There are several ways you can start up a SAMP hub:
Using an Existing Hub¶
Using the Command-Line Hub Utility¶
You can make use of the
samp_hub command-line utility, which is included in
To get more help on available options for
$ samp_hub -h
To stop the server, press control-C.
Starting a Hub Programmatically (Advanced)¶
You can start up a hub by creating a
SAMPHubServer instance and starting it,
either from the interactive Python prompt, or from a Python script:
>>> from astropy.samp import SAMPHubServer >>> hub = SAMPHubServer() >>> hub.start()
You can then stop the hub by calling:
However, this method is generally not recommended for average users because it does not work correctly when web SAMP clients try to connect. Instead, this should be reserved for developers who want to embed a SAMP hub in a GUI, for example. For more information, see Embedding a SAMP Hub in a GUI.