关于异步套接字(客户端)有些困惑 [英] Slightly confused about Asynchronous Sockets (Client)

查看:77
本文介绍了关于异步套接字(客户端)有些困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我编写了一个应用程序,目的是与服务器不断交换数据.但是,我希望在此过程中建立更多的连接.就像从一个进程到服务器的10条连接一样.

我仍然看不到异步处理背后的概念:

我想要这样->

CConnection连接[10];

并在某处处理这样的接收->

如果我准备接收,则接收数据并将其传递给当前选择的连接."
如:connections [selected]-> HandleRecv(bRecievedData);

有人可以解释一下如何实现这一目标吗?

谢谢

Hello,

I coded an application which purpose is to continually exchange data with server. However I would like to have more connections established in this process. Like 10 connections from one process to the server at the same time.

I still doesn''t see the concept behind asynchronous handling:

I would like to have it like this ->

CConnection connections[10];

and somewhere handling the receive like this ->

"If I''m ready to receive, then receive data and pass it to currently selected connection."
Like: connections[selected]->HandleRecv(bRecievedData);

Could someone please explain me how to achieve such goal?

Thank you

推荐答案

下载并设计Echoc.exe-简单的重叠套接字客户端示例
http://support.microsoft.com/kb/193066 [
Download and stydy Echoc.exe - Simple Overlapped Socket Client Sample
http://support.microsoft.com/kb/193066[^]

Regards
Espen Harlinn


这篇关于关于异步套接字(客户端)有些困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆