??????????-SOCKETЭ??????
?????stone_xiao ???????[ 2016/11/2 11:01:41 ] ???????????????
????????????????????????????????????????Э?????????????????Э?飬???????SOCKETЭ????????????C/S????????
??????????????????????C/S?????????????????????????????????????????????????????£?
#include "lrs.h"
#include <sub1.h>
#include <sub2.h>//??????2????????C??????LR?????C++???????C++????????????
Action()
{
unsigned char cLine[2048]={0};
unsigned char cOut[2048]={0};
unsigned char cOut2[2048]={0};
unsigned char retu1[2048]={0};
int len = 0;
int len1 = 0;
int rc??i??re;
lr_start_transaction("Conn_socket");
rc = lrs_create_socket("socket0"?? "TCP"?? "RemoteHost=127.0.0.1:22222"?? LrsLastArg);//????SOCKET????
//lr_output_message("rc=%d"??rc);
//???????????ж?
if (rc != 0 ) {
lr_end_transaction("Conn_socket"?? LR_FAIL);
return 0;
}
lr_end_transaction("Conn_socket"?? LR_PASS);
lr_start_transaction("sender");
strcpy(cLine??lr_eval_string("<shuju>" ));//LR??????????C????
len = strlen((char*)cLine);//??????????????
//??????ASCII??
AsciiToHex(cLine??cOut??len);
//???????cOut??????
len1 = strlen((char*)cLine)/2;
lrs_save_param_ex("socket0"?? "user"?? (char *)cOut?? 0?? len1??"ascii"?? "sender0");
lrs_send("socket0"??"buf0"?? LrsLastArg);
lrs_receive("socket0"??"buf1"??LrsLastArg);
lrs_save_param( "socket0"?? LRS_LAST_RECEIVED?? "Parame1"?? 0?? -1 );
strcpy(retu1??lr_eval_string("<Parame1>"));
re = lrs_get_last_received_buffer_size("socket0");
//ASCII????????
HexToAscii( retu1??cOut2??re);
lr_output_message("return is %d"??re);
if( cOut2 == cLine )//?????????ж?
lr_end_transaction("sender"?? LR_PASS);
else
lr_end_transaction ("sender"?? LR_FAIL);
lrs_close_socket("socket0");
return 0;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11