在Win32中使用TCP/IP进行异步数据传输 [英] Asynchronous Data Transfer using TCP/IP in Win32

查看:201
本文介绍了在Win32中使用TCP/IP进行异步数据传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.我有问题.我想在VC ++ 2010中使用TCP/IP套接字编程来传输图像.不幸的是,我的接收方代码仅接收第一帧/图像,但是发送方继续发送图像.在我的接收方中,第一次只有accept()和recv()函数可以正常工作,但是在第一次迭代之后,控制在行accept()函数中停止.但是那个时候发件人继续发送从网络摄像头拍摄的图像.我听说这一次概率异步传输是必要的.但不幸的是,我无法做到这一点.请给我解决方法.

谢谢.

Hi all. I have problem. I want to transfer images using TCP/IP socket programming in VC++ 2010. Unfortunately my reciever code recieve only first frame/image, but sender side continue send the images. In my reciever side first time only accept() and recv() function working properly, but after first iteration control stop in the line accept() function. But that time sender continue send the images taken from webcam. I have heard that this time probabli asynchronous transfer is necesaary. But unfortunately I am unable to do that. Please give me solution.

Thanking you.

推荐答案



您可以执行以下操作:

输入一个循环,在其中我们:
1.调用accept()等待传入连接
2.在我们的新连接上服务请求
3.关闭我们的连接,并继续循环以等待新的连接


本文将帮助您了解TCP/IP机制从Winsock编程开始-简单的TCP服务器 [ ^ ]
Hi,

You can do the following:

Enter a loop in which we:
1. Call accept() to wait for an incoming connection
2. Service the request on our new connection
3. close() our connection, and continue the loop to wait for a new one


This article would help you understand the TCP/IP mechanism Beginning Winsock Programming - Simple TCP server[^]


这篇关于在Win32中使用TCP/IP进行异步数据传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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