Search code examples
c#node.jssocket.io

How to connect C# with node.js via socket.io


i try to connect a c sharp application to node.js using SocketIoClientDotNet but it doesn't work take a look at my codes

using Quobject.SocketIoClientDotNet.Client;
var socket = IO.Socket("http://localhost:7000");
socket.On(Socket.EVENT_CONNECT, () =>
{
    socket.Emit("hi");
});
socket.On("hi", (data) =>
    {
        Console.WriteLine(data);
        socket.Disconnect();
    });
Console.ReadLine()

And error is here

E:\xamp\htdocs\connexion>node test_server_2.js
   info  - socket.io started
   info  - unhandled socket.io url

Solution

  • I found! i should upgrade socket.io from 0.9.16 to 1.3.5 and it works! thanks for all