background image
<< you save the parameter | Determine the socket >>
<< you save the parameter | Determine the socket >>

telnet session

Creating Vuser Scripts
Chapter 12, page 226
Windows Sockets Vuser Scripts · Developing Windows Sockets Vuser Scripts
In
In the following example, a user performed a
telnet
session. The user used a
ps
command to determine the process ID (PID), and killed an application based on its
PID.
The recorded script shows the lrs_receive and lrs_send functions:
During execution, the PID of the procedure will be different (UNIX assigns unique
PIDs for every execution), so killing the recorded PID will be ineffective. To
overcome this problem, lrs_save_param saves the value of the new PID to a
parameter. This parameter is referenced in the Send buffer which contains the kill
command.
frodo:/u/jay>ps
PID TTY TIME CMD
23961 pts/11 0:00 clock
23960 pts/11 0:00 vi
23959 pts/11 0:00 clock
23926 pts/11 0:03 tcsh
frodo:/u/jay>kill 23961
[3] Exit 1 clock
frodo:/u/jay>
lrs_receive("socket1", "buf79", LrsLastArg);
lrs_send("socket1", "buf80", LrsLastArg);