51Testing软件测试论坛

标题: socket脚本发送失败原因? [打印本页]

作者: abyss911    时间: 2009-2-17 01:05
标题: socket脚本发送失败原因?
Action()
{
    unsigned char Buffer[4];
    Buffer[0]=0x31;
    Buffer[1]=0x32;
    Buffer[2]=0x33;
    Buffer[3]=0x81;

        lrs_create_socket("socket0", "TCP", "RemoteHost=188.188.188.234:30001", LrsLastArg);

        lrs_set_send_buffer("socket0", (char *) Buffer,sizeof(Buffer));

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


//        lrs_free_buffer((char *)Buffer);
//        lrs_close_socket("socket0");

        return 0;

}
lrs_set_send_buffer返回的是成功,担提示错误:
Action.c(16): Error : Unable to translate buffer to socket0. Error code : 9013.
当Buffer[3]==0x80时就可以发送成功,请各位帮忙看看什么原因,谢谢.
作者: archonwang    时间: 2009-2-17 14:57
看下这个。http://bbs.51testing.com/viewthread.php?tid=98102




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2