Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate a C# client into a node.js + socket.io chat app

As part of learning node.js, I just created a very basic chat server with node.js and socket.io. The server basically adds everyone who visits the chat.html wep page into a real time chat and everything seems to be working!

Now, I'd like to have a C# desktop application take part in the chat (without using a web browser control :)).

What's the best way to go about this?

like image 467
paul Avatar asked Aug 19 '26 02:08

paul


1 Answers

I created a socket server in nodejs, and connected to it using TcpClient.

using (var client = new TcpClient())
{
    client.Connect(serverIp, port));
    using (var w = new StreamWriter(client.GetStream()))
        w.Write("Here comes the message");
}
like image 138
Erdogan Kurtur Avatar answered Aug 21 '26 17:08

Erdogan Kurtur



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!