51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1552|回复: 1
打印 上一主题 下一主题

[原创] windows sockets问题!急

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2009-10-15 10:47:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
小弟用windows sockets协议测试C/S客户端
客户端用VC开发
录制脚本如下
#include "lrs.h"


Action()
{
    lrs_create_socket("socket0", "TCP", "RemoteHost=SER-92:43220",  LrsLastArg);

    lrs_close_socket("socket0");

    lrs_create_socket("socket1", "TCP", "RemoteHost=SER-92:43220",  LrsLastArg);

    lrs_close_socket("socket1");

    lrs_create_socket("socket2", "TCP", "RemoteHost=NETSERVER:8512",  LrsLastArg);

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

    lrs_receive("socket2", "buf1", LrsLastArg);

    lrs_send("socket2", "buf2", LrsLastArg);

    lrs_receive("socket2", "buf3", LrsLastArg);

    lrs_close_socket("socket2");

    lrs_create_socket("socket3", "TCP", "RemoteHost=KL:8519",  LrsLastArg);

    lrs_send("socket3", "buf4", LrsLastArg);

    lrs_receive("socket3", "buf5", LrsLastArg);

    lrs_send("socket3", "buf6", LrsLastArg);

    lrs_receive("socket3", "buf7", LrsLastArg);

    lrs_create_socket("socket4", "TCP", "LocalHost=0", "RemoteHost=SER-92:80",  LrsLastArg);

    lrs_create_socket("socket5", "TCP", "LocalHost=0", "RemoteHost=SER-92:80",  LrsLastArg);

    lrs_send("socket4", "buf8", LrsLastArg);

    lrs_send("socket5", "buf9", LrsLastArg);

    lrs_send("socket3", "buf10", LrsLastArg);

    lrs_receive("socket3", "buf11", LrsLastArg);

    lrs_receive("socket4", "buf12", LrsLastArg);

    lrs_send("socket4", "buf13", LrsLastArg);

    lrs_receive("socket5", "buf14", LrsLastArg);

    lrs_send("socket5", "buf15", LrsLastArg);

    lrs_receive("socket4", "buf16", LrsLastArg);

    lrs_receive("socket5", "buf17", LrsLastArg);

    lrs_receive("socket4", "buf18", LrsLastArg);

    lrs_receive("socket5", "buf19", LrsLastArg);

    lrs_receive("socket4", "buf20", LrsLastArg);

    lrs_receive("socket5", "buf21", LrsLastArg);

    lrs_send("socket4", "buf22", LrsLastArg);

    lrs_receive("socket4", "buf23", LrsLastArg);

    lrs_send("socket5", "buf24", LrsLastArg);

    lrs_receive("socket5", "buf25", LrsLastArg);

    lrs_send("socket4", "buf26", LrsLastArg);

    lrs_receive("socket4", "buf27", LrsLastArg);

    lrs_send("socket5", "buf28", LrsLastArg);

    lrs_receive("socket5", "buf29", LrsLastArg);

    lrs_send("socket4", "buf30", LrsLastArg);

    lrs_receive("socket4", "buf31", LrsLastArg);

    lrs_send("socket5", "buf32", LrsLastArg);

    lrs_receive("socket5", "buf33", LrsLastArg);

    lrs_send("socket4", "buf34", LrsLastArg);

    lrs_receive("socket4", "buf35", LrsLastArg);

    lrs_send("socket5", "buf36", LrsLastArg);

    lrs_receive("socket5", "buf37", LrsLastArg);

    lrs_send("socket5", "buf38", LrsLastArg);

    lrs_receive("socket5", "buf39", LrsLastArg);

    lrs_send("socket4", "buf40", LrsLastArg);

    lrs_create_socket("socket6", "TCP", "LocalHost=0", "RemoteHost=218.30.115.62:80",  LrsLastArg);

    lrs_send("socket5", "buf41", LrsLastArg);

    lrs_create_socket("socket7", "TCP", "LocalHost=0", "RemoteHost=218.30.115.62:80",  LrsLastArg);

    lrs_receive("socket5", "buf42", LrsLastArg);

    lrs_receive("socket4", "buf43", LrsLastArg);

    lrs_send("socket5", "buf44", LrsLastArg);

    lrs_receive("socket5", "buf45", LrsLastArg);

    lrs_send("socket4", "buf46", LrsLastArg);

    lrs_receive("socket4", "buf47", LrsLastArg);

    lrs_send("socket5", "buf48", LrsLastArg);

    lrs_receive("socket5", "buf49", LrsLastArg);

    lrs_send("socket6", "buf50", LrsLastArg);

    lrs_send("socket7", "buf51", LrsLastArg);

    lrs_send("socket4", "buf52", LrsLastArg);

    lrs_receive("socket4", "buf53", LrsLastArg);

    lrs_receive("socket6", "buf54", LrsLastArg);

    lrs_send("socket6", "buf55", LrsLastArg);

    lrs_receive("socket7", "buf56", LrsLastArg);

    lrs_receive("socket6", "buf57", LrsLastArg);

    lrs_send("socket3", "buf58", LrsLastArg);

    lrs_receive("socket3", "buf59", LrsLastArg);

    lrs_send("socket3", "buf60", LrsLastArg);

    lrs_receive("socket3", "buf61", LrsLastArg);

    lrs_send("socket3", "buf62", LrsLastArg);

    lrs_receive("socket3", "buf63", LrsLastArg);

    lrs_send("socket3", "buf64", LrsLastArg);

    lrs_receive("socket3", "buf65", LrsLastArg);

    lrs_send("socket3", "buf66", LrsLastArg);

    lrs_receive("socket3", "buf67", LrsLastArg);

    lrs_send("socket3", "buf68", LrsLastArg);

    lrs_receive("socket3", "buf69", LrsLastArg);

    lrs_send("socket3", "buf70", LrsLastArg);

    lrs_receive("socket3", "buf71", LrsLastArg);

    lrs_send("socket3", "buf72", LrsLastArg);

    lrs_receive("socket3", "buf73", LrsLastArg);

    lrs_send("socket3", "buf74", LrsLastArg);

    lrs_receive("socket3", "buf75", LrsLastArg);

    lrs_send("socket3", "buf76", LrsLastArg);

    lrs_receive("socket3", "buf77", LrsLastArg);

    lrs_send("socket3", "buf78", LrsLastArg);

    lrs_receive("socket3", "buf79", LrsLastArg);

    lrs_send("socket3", "buf80", LrsLastArg);

    lrs_receive("socket3", "buf81", LrsLastArg);

    lrs_send("socket3", "buf82", LrsLastArg);

    lrs_receive("socket3", "buf83", LrsLastArg);

    lrs_send("socket3", "buf84", LrsLastArg);

    lrs_receive("socket3", "buf85", LrsLastArg);

    lrs_send("socket3", "buf86", LrsLastArg);

    lrs_receive("socket3", "buf87", LrsLastArg);

    lrs_send("socket3", "buf88", LrsLastArg);

    lrs_receive("socket3", "buf89", LrsLastArg);

    lrs_close_socket("socket3");

    return 0;
}
调试报错如下
Virtual User Script started
Starting action vuser_init.
vuser_init.c(12): lrs_startup(257)
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(12): lrs_create_socket(socket0, TCP, ...)
Action.c(12): Error : callConnect - Connection refused. Error code : 10061.
Action.c(12): Error : Timeout expired while trying to connect. Error code : 9017.
Abort was called from an action.
Ending Vuser...
Starting action vuser_end.
vuser_end.c(12): lrs_cleanup()
Ending action vuser_end.
Vuser Terminated.

请问这个报错什么原因导致,如何解决呢?
谢谢各位!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2009-10-15 11:11:09 | 只看该作者
有人知道怎么解决吗?
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-10-6 22:29 , Processed in 0.080314 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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