本文介绍了通过套接字异步数据接收的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我正在编写一个代码,我将通过套接字调用BeginReceive方法接收数据,这是异步的。我需要知道何时完成接收数据包,因为我将测量发送和接收数据之间的时间。我该怎么办
呢?我在MSDN上寻找解决方案而且我找到了"IsCompleted"属性,但是它对我来说是不对的。
I'm writing a code where I'll receive data via socket calling the method BeginReceive, that is asynchronous. I need to know when I finished to receive a data package, cause I'll measure the time between the sending and receiving of the data. How can I do this? I was looking for solutions on MSDN and I found the "IsCompleted" property, but it does not work the right way for me.
推荐答案
这篇关于通过套接字异步数据接收的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!