c# - XSocket client with Socket.IO backend? -


i wondering if it's possible use xsocket client , socket.io server side.

i pretty sure wouldn't work read this post, opposite of i'd do. , seems work. major difference guess i'm not writing server, i'm trying use 1 exists.

here's have far:

    public static void main (string[] args)     {         try{             const string clientid = "--myclientid--";             const string accesstoken = "--myaccesstoken--";              xsocketclient client = new xsocketclient ("https://streamtip.com", "https://streamtip.com", "streamtipio");              client.querystring.add("client_id", uri.escapedatastring(clientid));             client.querystring.add("access_token",uri.escapedatastring(accesstoken));              client.onerror +=                  (object sender, xsockets.client40.common.event.arguments.onerrorargs e) => console.writeline (e);             client.onconnected +=                  (object sender, eventargs e) => console.writeline ("connected");             client.ondisconnected +=                  (object sender, eventargs e) =>  console.writeline ("disconnected");             client.onping +=                  (object sender, xsockets.client40.model.message e) => console.writeline (e);             client.onpong +=                  (object sender, xsockets.client40.model.message e) => console.writeline (e);               //client.controller("test").on("authenticated", () => console.writeline("test"));             client.controller("streamtipio").on<string>("authenticated", console.writeline);              client.open();         }         catch(exception e)         {             console.writeline (e);         }          console.readline ();     } 

the weird bit seems connect, i'm not getting data.... assume controllers , fact made on up, i'm not sure you'd name controller when trying use socket.io backend...

--output

disconnected

connected

oddly enough disconnected fires first.... not sure that's about

on side note:

i'd beable connect socket.io servers in c# seems arbitrary.. i've tried few c# socket.io ports, socketioclientdotnet works perfectly, until try run in mono has error

you can connect tcp xsockets.net server since xsockets allows cross-protocol communication. in clear text means xsockets not care "transport" or "language" of each client. server not care message format either since each protocol responsible converting messages going in/out

you can not use xsockets client socket.io server. connect, format of messages not fit directly socket.io.

since mission seems to use c#/mono socket.io take xsockets c# client (or other websocket client in c#) , rebuild socket.io. xsockets client runs on mono , open source on github

my guess other clients easier port since xsockets client specific xsockets , more complex simple websocket client in c#


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -