需要使用System.Net.WebSockets命名空间实现Client Web Sockets的帮助 [英] Need help in implementing Client Web Sockets using System.Net.WebSockets namespace

查看:1595
本文介绍了需要使用System.Net.WebSockets命名空间实现Client Web Sockets的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


亲爱的所有人, 

Dear All, 


我们正在为Web Socket客户端开发代码使用C#.Net的边码。我们目前正在使用System.Net.WebSockets命名空间中的CleintWebSocket类。我们使用ClientWebSocket类的ConnectAsync函数连接到

服务器 
WebSocket。我们需要在使用ConnectAsync异步建立连接时调用回调函数。

We are developing code for Web Socket Client side code using C#.Net. We are currently using CleintWebSocket class from System.Net.WebSockets namespace. We are using ConnectAsync function of the ClientWebSocket class to connect to the Server WebSocket. We need to call a callback function when the connection is established asynchronously using the ConnectAsync.


 我们不知道如何调用我们的回调函数,请指导我们解决问题。

 We don’t know how to call our callback function, please guide us to fix the issue.


 请做必要。

 Please do the needful.


 

 


谢谢,


Raghu Devisetti

Raghu Devisetti

推荐答案

您好Raghu Devisetti,

Hi Raghu Devisetti,

感谢您在此发帖。

对于您的问题,什么是要调用的回调函数吗?

For your question, what is the callback function you want to call?

ClientWebSocket.ConnectAsync方法将返回一个任务。在ClientWebSocket实例上的连接请求完成后,返回的Task对象将完成。您可以在返回值任务之后执行其他操作。

ClientWebSocket.ConnectAsync Method will return a task. The returned Task object will complete after the connect request on the ClientWebSocket instance has completed. You could do the other things after you the return value task.

最好的问候,

Wendy


这篇关于需要使用System.Net.WebSockets命名空间实现Client Web Sockets的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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