|
回复 1# 地铁和人海
使用lrs_set_send_buffer试试,自定义buf可以,希望有用
lr_start_transaction("socket_test");
lrs_send("socket1","buf0", LrsLastArg);
lrs_receive("socket1","buf1",LrsLastArg);
lrs_get_last_received_buffer("socket1", &ActualBuffer, &NumberOfBytes);
// lr_output_message("*********获取msg1返回结果***********==:%x",ActualBuffer);
lr_save_var(ActualBuffer+0,3,0,"key1");
lr_save_var(ActualBuffer+0,3,0,"key1");
if ((strstr(lr_eval_string("<key1>"),"hey"))) {
lr_end_transaction("socket_test",LR_PASS);
}else{
lr_end_transaction("socket_test",LR_FAIL);
}
lr_start_transaction("test1");
lrs_set_send_buffer("socket1",ActualBuffer,9);//actualBuffer为真实发送内容,可以从上次的返回中获得
lrs_send("socket1","buf2",LrsLastArg);//发送
lrs_free_buffer(ActualBuffer);//释放内存
lrs_receive_ex("socket1","buf20",LrsLastArg);//"NumberOfBytesToRecv=4",
lrs_get_last_received_buffer("socket1",&BufVal, &intGetLen);
lr_save_var(BufVal+0,3,0,"key1");
if ((strstr(lr_eval_string("<key1>"),"hey"))) {
lr_end_transaction("test1",LR_PASS);
}else{
lr_end_transaction("test1",LR_FAIL);
} |
|