[UWP]传入套接字事件 [英] [UWP] Incoming socket events
本文介绍了[UWP]传入套接字事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何事件可以识别现有套接字中传入的新数据包?当我连接时,我必须注意传入的数据包,但没有事件发生。
Is there any event that can recognize new packet incoming in existing socket? When I am connected, I have to watch for incoming packets, but there is no event for that.
推荐答案
嗨 110mat110,
Hi 110mat110,
您可以使用 SocketActivityTrigger
启动后台任务以处理套接字活动。这是 SocketActivityStreamSocket
示例,它展示了如何使用保持套接字的
StreamSocket 套接字活动流API超出应用程序生命周期的连接。
You can use the SocketActivityTrigger to launch a background task for handling socket activity. Here is the SocketActivityStreamSocket sample, it shows how to use the StreamSocket Socket Activity Stream API to keep a socket connection alive beyond the lifetime of the application.
祝你好运,
Breeze
这篇关于[UWP]传入套接字事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文