Using socket Commands
socket inspect
Note
socket disconnect
Cisco Content Services Switch Administration Guide
8-40
To inspect the socket's internal data buffer for actual data, use the socket inspect
command. If the software finds data, it displays to standard output the last 10 KB
of data received. If the displayed characters are non-printable, the software
represents them with a period character (.) for readability. (See the example under
the pretty argument, below.)
The syntax for this command is:
socket inspect socket_number {pretty}{raw}
The options and variables are:
socket_number - Socket file descriptor (integer form). This descriptor is
•
returned by the socket connect command.
•
raw - Displays the string values as hexadecimal bytes instead of a simple
string. For example, instead of printing "ABCD" to standard output, it prints
"41424344" (1-byte hexadecimal equivalent).
pretty - Prints each line with both the hexadecimal and the ASCII equivalent
•
for each byte of data. The software prints up to 16 bytes on each line. For
example, enter: "0x41 0x42 0x43 0x44 0x10 0x05 ABCD.."
If you use the socket inspect command in a keepalive script, you must use the
"use-output" option in the command line when configuring the keepalive type for
the service.
To close the connection to the remote host by sending RST (reset) to the remote
host so that it knows that the CSS is finished sending data, use the socket
disconnect command.
The syntax for this command is:
socket disconnect socket_number {graceful}
socket_number - Socket file descriptor (integer form). This descriptor is
•
returned by the socket connect command.
Chapter 8
Using the CSS Scripting Language
OL-5647-02