Action()
{
lr_start_transaction("开始登陆");
lrs_create_socket("socket0", "UDP", "LocalHost=6223", LrsLastArg);
lrs_send("socket0", "buf0", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_create_socket("socket1", "UDP", "LocalHost=30000", LrsLastArg);
lrs_receive("socket0", "buf1", LrsLastArg);
lrs_send("socket1", "buf2", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf3", LrsLastArg);
lrs_send("socket1", "buf4", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf5", LrsLastArg);
lrs_send("socket1", "buf6", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf7", LrsLastArg);
lrs_send("socket1", "buf8", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf9", LrsLastArg);
lrs_send("socket1", "buf10", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf11", LrsLastArg);
lrs_send("socket1", "buf12", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf13", LrsLastArg);
lrs_send("socket1", "buf14", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf15", LrsLastArg);
lrs_send("socket1", "buf16", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf17", LrsLastArg);
lrs_send("socket1", "buf18", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf19", LrsLastArg);
lrs_send("socket1", "buf20", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf21", LrsLastArg);
lrs_send("socket1", "buf22", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lr_end_transaction("结束登陆", LR_AUTO);
lr_think_time(12);
lrs_send("socket1", "buf23", "TargetSocket=LOCALHOST:15000", LrsLastArg);
lrs_receive("socket1", "buf24", LrsLastArg);
return 0;
}
报错:
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(12): Notify: Transaction "开始登陆" started.
Action.c(14): lrs_create_socket(socket0, UDP, ...)
Action.c(14): Error : socket0 - Address already in use. Error code : 10048.
Action.c(14): Notify: Transaction "开始登陆" ended with "Fail" status (Duration: 0.0231).
Abort was called from an action.
Ending Vuser...
Starting action vuser_end.
vuser_end.c(12): lrs_cleanup()
Ending action vuser_end.
Vuser Terminated.