需要使用System.Net.WebSockets命名空间实现Client Web Sockets的帮助

编程入门 行业动态 更新时间:2024-10-09 21:25:46
本文介绍了需要使用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 ServerWebSocket. 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的帮助

本文发布于:2023-11-07 15:44:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566850.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:空间   WebSockets   Net   System   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!