Cisco 11503 Administration Guide - Page 288
SOCKET Variable
UPC - 746320664958
View all Cisco 11503 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 288 highlights
Special Variables Chapter 8 Using the CSS Scripting Language SOCKET Variable The SOCKET variable contains the connection ID associated with a host. When you connect to a remote host, the SOCKET variable is set so that you can send and receive messages by referring to this variable. When you use the socket commands, the SOCKET variable is set automatically (see "Using socket Commands" later in this chapter). When you make multiple connections using the socket commands, save the SOCKET variable to another variable or it will be overwritten. For example, enter: set EXIT_MSG "Failure to connect to host" socket connect host 1.1.1.1 port 80 no set EXIT_MSG set EXIT_MSG "Send: Failure" socket send ${SOCKET} "GET /index.html\n\n" no set EXIT_MSG ! Save current socket ID set OLD_SOCKET "${SOCKET}" ! The new socket connect command will overwrite the old ! ${SOCKET} variable set EXIT_MSG "Failure to connect to host" socket connect host 1.1.1.1 port 80 no set EXIT_MSG set EXIT_MSG "Send: Failure" socket send ${SOCKET} "GET /index.html\n\n" no set EXIT_MSG set EXIT_MSG "Waitfor: Failed" socket waitfor ${OLD_SOCKET} "200 OK" socket waitfor ${SOCKET} "200 OK" ! Finished, cleanup no set EXIT_MSG socket disconnect ${OLD_SOCKET} socket disconnect ${SOCKET} 8-20 Cisco Content Services Switch Administration Guide OL-5647-02