I need a nodejs server connected to a C # application, I don't like using third-party libraries, so I'm trying to use TcpClient, the server looks something like this:
var io = require('socket.io').listen(8000);
io.socket.on('connection',function(socket)
{
console.log("connected");
}
and in a C # project:
var client = new TcpClient(Server,8000);
Socket s = client.Client;
if (!s.Connected)
{
s.SetSocketOption(SocketOptionLevel.Socket,
SocketOptionName.ReceiveBuffer, 16384);
MessageBox.Show("disconnected");
}
else
{
MessageBox.Show("connected");
s.Send(Encoding.UTF8.GetBytes("something"));
}
for what i understood in "something", i have to write something that will call "on (" connection ") on the nodejs side, am i missing something?
PS: if you know a good third-party library for what I need, you can mention it
source
share