51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1130|回复: 2
打印 上一主题 下一主题

[原创] socket协议录制的脚本在回放时总提示10054的错误

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2007-3-28 18:24:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1、被测试的程序是一个中间应用,由于服务器只允许几个ip地址登陆,所以该程序的作用是将其他多个ip转换到这几个ip上,再联服务器
2、使用socket协议录制,录制以后的脚本如下:
int handler=0;
    lrs_create_socket("socket0", "TCP", "RemoteHost=192.168.1.123:4545", LrsLastArg);
    lrs_send("socket0", "buf0", LrsLastArg);
    lrs_set_socket_handler("socket0", handler);
    lrs_receive("socket0", "buf1",LrsLastArg);
    lrs_close_socket("socket0");
    return 0;
3、两次录制脚本相同,但录制的日志不同
第一次:
* WSAStartup(): process 3740 using flags 0 */
/* ReadCommWindowInfo: HttpInterceptMode = 0 */
/* socket(): created with handle: 3740:116, address format 2, type 1, protocol 0. */
/* connect(): socket 3740:116 tried to connect with family 2, port 4545, and address 0xc0a8017b. Return value: 0 */
/* send(): 10000 bytes were sent to socket 3740:116 using flags 0 */
/* recv(): 2748 bytes were received from socket 3740:116 using flags 0 (10000 were asked for) */
/* recv failed */
/* closesocket(): socket 3740:116 closed successfully */
/* WSACleanup() was called on process 3740 */
第二次:
/* WSAStartup(): process 3904 using flags 0 */
/* ReadCommWindowInfo: HttpInterceptMode = 0 */
/* socket(): created with handle: 3904:116, address format 2, type 1, protocol 0. */
/* connect(): socket 3904:116 tried to connect with family 2, port 4545, and address 0xc0a8017b. Return value: 0 */
/* send(): 10000 bytes were sent to socket 3904:116 using flags 0 */
/* recv(): 2748 bytes were received from socket 3904:116 using flags 0 (10000 were asked for) */
/* recv failed */
/* closesocket(): socket 3904:116 closed successfully */
/* WSACleanup() was called on process 3904 */

说明每次的socket handle不同
4、回放脚本,提示错误信息:
Action.c(23): Error : socket0 - Connection reset by peer. Error code : 10054.
5、根据录制的日志信息,我怀疑是因为socket handle的问题,可是脚本中就4句,我应该怎么修改呢?

向各位大虾请教,谢谢?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2007-3-29 10:44:28 | 只看该作者
你应该使用悬赏贴而不是买卖贴,使用买卖贴别人浏览您的贴子需要支付给你积分的
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2007-4-2 09:11:18 | 只看该作者
lrs_get_socket_handler你前面加一句这个,然后再set。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-28 08:39 , Processed in 0.083693 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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