xifan1014 发表于 2012-3-2 18:01:13

关于socket参数化的一个问题

#include <lrs.h>

char * str;
char * str1;

Action()
{
   ·············

lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=WK-234:20002", LrsLastArg);

lrs_create_socket("socket1", "TCP", "LocalHost=0", "RemoteHost=WK-234:20001", LrsLastArg);

lr_start_transaction("login");

lrs_send("socket1", "buf0", LrsLastArg);

lrs_save_param("socket1", "buf0", "param1", 35, 4);

str=lr_eval_string("{param1}");

str1="1";

strcat(str, str1);

lr_save_string(str, "param1");

lr_output_message("param1:%s", lr_eval_string("{param1}"));

lrs_receive("socket1", "buf1", LrsLastArg);

lrs_send("socket0", "buf2", LrsLastArg);

lrs_receive("socket0", "buf3", LrsLastArg);

lrs_send("socket1", "buf4", LrsLastArg);

lrs_receive("socket1", "buf5", LrsLastArg);

lr_end_transaction("login",LR_AUTO);
   ············
lrs_close_socket("socket0");

lrs_close_socket("socket1");

return 0;
}


;WSRData 2 1

sendbuf0 40

"\x00\x00\x00"

"\""

"\x00\x01"

"\n"

"\v"

"\x01\x11"

"passWord"

"\x06\x03"

"1"

"\x17"

"accountName"

"\x06"

"\t3221"

"\x01"





循环3次执行后每次得出的param1值都为32211,第一次执行后得出的“32211”值不会使用到下一次执行么(也就是第一次结束后param1=32211,第二次得值为322111,第三次得值为3221111)?
页: [1]
查看完整版本: 关于socket参数化的一个问题