How to disconnect socket io?

Post your work in progress addons and get feedback

Post » Wed Jan 02, 2013 7:47 am

I tried to create multiplayer game using socket.io. When i tried to disconnect socket io at client, i got this error. Can anyone help me?

Thanks for any help!

Client

Server

Error
B
4
Posts: 13
Reputation: 481

Post » Wed Jan 02, 2013 8:38 am

What socket.io plugin are you using?

There are several versions of the plugin currently on the forums, so it would be helpful to share which are you utilizing!

Cheers!
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652

Post » Wed Jan 02, 2013 8:55 am

I used this version, thank you. https://www.dropbox.com/s/wbot32mika12r75/Socket%20io.rar



I opened edittime.js:
"author": "Original work: Zack0Wack0 - LastDataElement modifications by juantar, minify by Johnny Sheffield",
phuong30302013-01-02 08:58:57
B
4
Posts: 13
Reputation: 481

Post » Wed Jan 02, 2013 9:15 am

Ahh, ok, that's the modifed version of zack0wack0's plugin.

please post any questions about this plugin

here.


Not sure what's the problem here, but i think you should set your own configuration on how the client behaves, please refer to this

I think the problem occurs somewhere around here; but i cannot tell without more info!

     instanceProto.connect = function(host,port)
     {          
          var socket = this.socket;
          //problem here?
          if(socket != undefined || socket != null)
               socket["disconnect"]();
          
          this.lastAddress = host;
          this.lastPort = port;
          
             //or problem here, maybe?
          socket = window["io"]["connect"]('http://' + host + ':' + port, {'force new connection': true});


Cheers!
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,652


Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 0 guests