亲爱的所有人,
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的帮助
发布评论