通过 c# 与 socket.io 服务器通信 [英] Communicating with a socket.io server via c#

查看:57
本文介绍了通过 c# 与 socket.io 服务器通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有遵循socket.io协议的c#客户端?我有一个 socket.io 服务器,它通过网站与 socket.io javascript 客户端通信,但我还需要将一个 c# 连接到它,它可以发送和接收消息.目前是否有一种干净的方法可以做到这一点,或者我是否必须编写自己的客户端.

Is there a c# client that follows the socket.io protocol? I have a socket.io server that is communicating with a socket.io javascript client via a website, but i also need to connect a c# piece to it that can send and receive messages. Is there a clean way to do this currently or will I have to write my own client.

推荐答案

codeplex 上有一个项目(NuGet ),它是 socket.io 的 C# 客户端.(我是这个项目的作者 - 所以我有偏见)我无法在客户端中准确找到我需要的东西,所以我构建了它并将其重新公开.

There is a project on codeplex ( NuGet as well ) that is a C# client for socket.io. (I am the author of this project - so I'm biased) I couldn't find exactly what I needed in a client, so I built it and released it back into the open.

客户风格示例:

socket.On("news", (data) =>    {
Console.WriteLine(data);
});

这篇关于通过 c# 与 socket.io 服务器通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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