Managing listeners with sp_listener

You can manage listeners with the sp_listener system procedure. sp_listener allows you to:

The syntax for sp_listener is:

sp_listener “command”, “server_name”, engine | remaining

orsp_listener “command”, “[protocol:]machine:port”, engine | remaining

The maximum number of listeners you can add in addition to the listeners created at startup is 32. The semantics for sp_listener is atomic: if a command cannot be completed successfully, it is aborted.

Where command is can be start, stop, suspend, resume, or status, server_name is the name of Adaptive Server, engine specifies the number of the engine affected by this command (this parameter is ignored by Windows NT, engine can be a single-engine number in quotes ("2"), a list ("3,5,6"), a range ("2-5"), or mix of all ("2,3-5,7”)), remaining specifies that the command is to take effect on all engines on which it can be meaningfully applied (that is, where the listener is in a state in which the command is can take effect), protocol is the protocol used (tcp, tli, ssltcp, ssltli, winsock, sslnlwnsck, or sslwinsock), and machine:port is the machine name and port number (as specified in the interfaces file) to which the listener listens.

The first syntax description above is intended for all master ports listed in the interfaces file. This syntax allows you to start, stop, suspend, or resume activity simultaneously on all master entries under the server name in the interfaces file. The second syntax description allows you to manage listeners not listed in the interfaces file.

Both syntaxes are dynamic, that is you do not have to restart Adaptive Server to implement the change.

NoteStopping a listener that is listed in the interfaces file does not remove this entry from the interfaces file.

The examples in this chapter use an Adaptive Server named “ASE1251” running on a host named “spartacus.” The examples using the first syntax for sp_listener apply only to the master ports registered in the interfaces file under Adpative Server ASE1251. Commands using the second syntax for sp_listener (in the form tcp:spartacus:4556) apply only to the single master port specified (4556 in this example). A master port is unambiguously determined by a network protocol, a hostname and a port number.