sp_listener

Description

Dynamically starts and stops listeners on Adaptive Server on any given port on a per-engine basis.

Syntax

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

Or:

sp_listener “command”, “[protocol:]machine:port”, engine

Parameters

command

can be any of the following:

server_name

is the name of the Adaptive Server, as specified in the interfaces file.

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

the type of protocol. This can be one of: tcp, tli, ssltcp, ssltli, winsock, sslnlwnsck, sslwinsock.

machine:port

the machine name and port number (as specified in the interfaces file) to which the listener connects.

Examples

Example 1

Create tcp listeners on engines 0-6 for port number 4226:

sp_listener "start", "goldie:4226", "0-6"

Example 2

Create listeners for all master entries in the interfaces file for server orion:

sp_listener "start", "orion", "remaining"

Example 3

Start listeners on engines 1, 3 and 5 for each master entry in the interfaces file corresponding to server orion:

sp_listener "start", "orion", "1,3,5"

Example 4

Start tcp listeners on port 4226 on machine goldie for all engines not already listening to this port:

sp_listener "start", "goldie:4226", "remaining"

Example 5

Stop the listener on port number 4226 on engine number 2:

sp_listener "stop", "tcp:goldie:4226", "2"

Example 6

Stop all listeners on port number 4226 for all engines. Because this command includes the remaining parameter, it will not fail if some engines are not listening to the port:

sp_listener "stop", "tcp:goldie:4226", "remaining"

Example 7

Suspend NT winsock listener on port 4226:

sp_listener "suspend", "winsock:clouds:4226"

Example 8

Resume NT winsock listener on port 4227:

sp_listener "suspend", "winsock:clouds:4226"

Example 9

Resume all active listeners on port number 4226:

sp_listener "resume", "tcp:goldie:4226", "remaining"

Usage