I am having a problem with the handshake with a socket.io i thing this is because of the headers
A first chance exception of type 'System.Net.WebException' occurred in System.dll
Error Event: Error initializing handshake with http://remoteadr.xx:8080/
System.Exception: Exception of type 'System.Exception' was thrown.
socket client error:
Error initializing handshake with http://remoteadr.xx:8080/
The program '[768] LocalApp.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
the c# code is
System.Net.WebRequest.DefaultWebProxy = null;
socket = new Client("http://remoteadr.xx:8080/"); // only dif. (/) ?!?
socket.Error += SocketError;
socket.On("connect", (fn) =>
{
MessageBox.Show("\r\nConnected event...\r\n");
});
// ERROR: DOES NOT CONTAIN DEFINITION for Headers ?!?!?!
// socket.HandShake.Headers.Add("OrganizationId", "1034");
// socket.HandShake.Headers.Add("UserId", "TestSample");
...
void SocketError(object sender, SocketIOClient.ErrorEventArgs e)
{
Console.WriteLine("socket client error:");
Console.WriteLine(e.Message);
}
the nodejs socket is working for another client side webapp, and i connect to it through some angularjs service at the same way but it works
.factory("socket", function(){
var socket = io.connect("http://remoteadr.xx:8080");
return socket;
})
while can't connect through this c# app. Maybe something is wrong with the headers cause i can't call
socket.HandShake.Headers.Add
the nodejs socket.io is 0.9 i switched from 1.0 thinking maybe it was a version problem, but still doesn't work..
// nodejs
var express = require("express"),
app = express(),
server = require("http").createServer(app),
io = require("socket.io").listen(server), // ...
...
io.sockets.on('connect', function() {
console.log("## new connection...".help);
});
there is no authentication with the angularjs client i can emit with no problem not just connect...
SOLVED must be for sure socket.io 0.9 for SocketIO4Net.Client and i still had old 1.0.* version i changed package.json to socket.io 0.9 and deleted the socket folder from the node_packages reinstalled npm socket.io@0.9.x and now i can tell is 0.9 version cause i have to fix some 1.0 specific functions but still, now even the socketIO4Net.Client is connecting so the real problem was the 1.0.x version