|
我录制脚本然后修改action如下:
Action()
{
//int a=1;
lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=192.168.1.58:554", LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_receive("socket0", "buf1", LrsLastArg);
lrs_send("socket0", "buf2", LrsLastArg);
lrs_receive("socket0", "buf3", LrsLastArg);
/*lrs_create_socket("socket1", "UDP", "LocalHost=15947", LrsLastArg);
lrs_send("socket1", "buf4", "TargetSocket=reserved-multicast-range-NOT-delegated.example.com:15947", LrsLastArg);
lrs_receive("socket1", "buf5", LrsLastArg);
lrs_close_socket("socket1");*/
lrs_send("socket0", "buf6", LrsLastArg);
lrs_receive("socket0", "buf7", LrsLastArg);
lrs_save_searched_string("socket0", NULL, "newsession", "LB/BIN= ", "RB/BIN=\r", 9, 0, -1);
//lrs_save_param("socket0", NULL, "newsession", 146, 10);
lr_output_message("session is:%s", lr_eval_string("<newsession>"));
lrs_send("socket0", "buf8", LrsLastArg);
lrs_receive("socket0", "buf9", LrsLastArg);
lrs_send("socket0", "buf31", LrsLastArg);
lrs_receive("socket0", "buf32", LrsLastArg);
lr_think_time(120);
//lrs_create_socket("socket2", "UDP", "LocalHost=0", LrsLastArg);
while(1)
{
lr_think_time(120);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_receive("socket0", "buf1", LrsLastArg);
lrs_send("socket0", "buf2", LrsLastArg);
lrs_receive("socket0", "buf3", LrsLastArg);
lrs_send("socket0", "buf6", LrsLastArg);
lrs_receive("socket0", "buf7", LrsLastArg);
lrs_save_searched_string("socket0", NULL, "newsession", "LB/BIN= ", "RB/BIN=\r", 9, 0, -1);
lr_output_message("session is:%s", lr_eval_string("<newsession>"));
lrs_send("socket0", "buf8", LrsLastArg);
lrs_receive("socket0", "buf9", LrsLastArg);
lrs_send("socket0", "buf31", LrsLastArg);
lrs_receive("socket0", "buf32", LrsLastArg);
}
我是为了让它循环,流媒体服务器是vlc服务器,此脚本循环了14个小时就over了,请高手指教,脚本中的bug 谢谢 |
|