I have problem connecting a C#.net windows form to a socket.io (node.js) server, here is my code for a simple button:
private void button1_Click(object sender, EventArgs e)
{
label_consol.Text=" init ";
var directSocket = new Client("http://127.0.0.1:3000/");
directSocket.Connect();
directSocket.On("connect", (fn) =>
{
label_consol.Text+=("\r\nConnected event...\r\n");
});
}
I also tried this with a built in TCP function from .net:
TcpClient client = new TcpClient("127.0.0.1", 3000);
Stream s = client.GetStream();
s.Close();
client.Close();
There is no error returned from the application, and i log every connection on socket.io server, nothing connected,
Or is there another way of connecting my windows form to a socket.io server?