51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 4306|回复: 0
打印 上一主题 下一主题

[原创] Error: C-interpreter run time error: Action.c (119)

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2009-4-4 11:45:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请教各位大侠为什么close_socket出错呢。。。。HELP下,谢谢了。
#include "lrs.h"

Action()
{
char inputBuf[512];
int sendLen,rc;
char *RTNCOD;
char *RTNMSG;
  char * revBuff;
char bufftmp[256];
int len;
    sprintf(inputBuf, "%s", lr_eval_string(
    "82    "
    "00TTY|    |90|210001|90010009|50703|{account}|1||1|G|{TransType}|0|1|{price}|{amount}|"
  ));
    sendLen=strlen(inputBuf);
lr_log_message("len=%d", sendLen);
    lr_log_message("inputBuf=%s",inputBuf);
    lrs_set_send_timeout(120, 0);
lrs_set_recv_timeout(120, 0);
lr_continue_on_error(1);
// lr_start_transaction("delay transaction");
    rc = lrs_create_socket("socket0", "TCP", "RemoteHost={IP_Addr}:{port}",  LrsLastArg);
if (rc!=0)  {
  lr_fail_trans_with_error("An error occurred while create socket, Error Code: %d", rc);
        lr_end_transaction("client_position_query",LR_FAIL);
  lr_exit(LR_EXIT_ITERATION_AND_CONTINUE,LR_FAIL);
}
lrs_set_send_buffer("socket0",inputBuf,strlen(inputBuf));
rc = lrs_send("socket0", "buf0", LrsLastArg);
    if (rc!=0)  {
       lr_fail_trans_with_error("An error occurred while sending to the socket, Error Code: %d", rc);
   lrs_close_socket("socket0");
      lr_end_transaction("delay transaction",LR_FAIL);
      lr_exit(LR_EXIT_ITERATION_AND_CONTINUE,LR_FAIL);}
lrs_set_recv_timeout(40, 0);
    rc = lrs_receive("socket0", "buf1", LrsLastArg);
    lr_message(" rc:%d\n", rc);
if (rc != 0 && rc != 9101)  
{
       lr_fail_trans_with_error("An error occurred while receiving from the socket, Error Code: %d", rc);
   lrs_close_socket("socket0");
      lr_end_transaction("delay transaction",LR_FAIL);
      lr_exit(LR_EXIT_ITERATION_AND_CONTINUE,LR_FAIL);
}
else
{
   //no data
    if (lrs_get_last_received_buffer_size("socket0") < 1)
   {
    lr_fail_trans_with_error("No data received on socket0");
    lrs_close_socket("socket0");
    lr_end_transaction("delay transaction",LR_FAIL);
    lr_exit(LR_EXIT_ITERATION_AND_CONTINUE,LR_FAIL);
    }
      //取得返回码
   RTNCOD = lrs_get_received_buffer("socket0", 61, 7, NULL);
   if(strcmp(RTNCOD, "AAAAAAA") !=0)
   {
    lr_fail_trans_with_error("错误码, RTNCOD: %s\n",RTNCOD);
    lrs_close_socket("socket0");
    lr_end_transaction("delay transaction",LR_FAIL);
    lr_exit(LR_EXIT_ITERATION_AND_CONTINUE,LR_FAIL);
   }
   else
   {
    lr_output_message( "RECEIVE<======>%s\n","交易成功");
   }
}
rc = lrs_close_socket("socket0");
    if (rc==0)  
{
      lr_end_transaction("delay transaction", LR_PASS);
  }
else
{
  lr_fail_trans_with_error("An error occurred while closing the socket, Error Code: %d", rc);
  lr_end_transaction("delay transaction",LR_FAIL);
}
lr_continue_on_error(0);
return 0;
}
---------------------------------------------

rc:9101
Action.c(116): RECEIVE<======>交易成功
Action.c(119): Error: C-interpreter run time error: Action.c (119):  Error -- memory violation : Exception ACCESS_VIOLATION received.
Action.c(119): Notify: CCI trace: Action.c(119): LrsCloseSocket(0x00bc06a1 "socket0")
.
Action.c(119): Notify: CCI trace: Compiled_code(0): Action()
.
vuser_end.c(6): Error: C-interpreter run time error: vuser_end.c (6):  Error -- memory violation : Exception ACCESS_VIOLATION received.
vuser_end.c(6): Notify: CCI trace: vuser_end.c(6): LrsCleanup()
.
vuser_end.c(6): Notify: CCI trace: Action.c(119): vuser_end()


.
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-19 16:22 , Processed in 0.064407 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表