CSocket——connect连接的问题

nomadist 2003-03-16 11:20:28
如果服务器没有打开,我发现连接的时间就会过长如何改变这样的情况。有没有牛人帮我说说,CSocket到底是怎么样连接的?
...全文
33 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
kingzai 2003-03-23
  • 打赏
  • 举报
回复
The problem is not in the connection itself, but in the call that resolves the address to the host. Those calls are gethostbyaddr and gethostbyname. They are
encapsulated in the CAsyncSocket class. CSocket derives from CAsyncSocket.
Check MSDN for documentation on asynchronous call to databases and on
WSAAsyncGetHostByName.
and Take a look at Microsoft KB, Q138692 - How to Configure a Time-Out on a
CSocket Operation.
http://support.microsoft.com/support/kb/articles/Q138/6/92.asp


swordman 2003-03-23
  • 打赏
  • 举报
回复
select
shesh 2003-03-23
  • 打赏
  • 举报
回复
select一下指定的事件就不阻塞了.
nomadist 2003-03-21
  • 打赏
  • 举报
回复
我想知道的是怎么在CSocket对象里面设置
比如说CSocket怎么设置非阻塞方式连接

peoney 2003-03-16
  • 打赏
  • 举报
回复
自己创建一个连接超时线程监视 或者使用setsockopt?
icansaymyabc 2003-03-16
  • 打赏
  • 举报
回复
或许可以设置“超时检测”的值小一点吧?
anjy 2003-03-16
  • 打赏
  • 举报
回复
http://www.vckbase.com/bbs/prime/viewprime.asp?id=471

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧