0 Favourites

How to disconnect socket io?

  • 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

    <img src="http://i49.tinypic.com/2uggo4p.png" border="0" />

    Server

    <img src="http://i47.tinypic.com/2rrpg06.png" border="0" />

    Error

    <img src="http://i50.tinypic.com/34ydaf4.png" border="0" />

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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!

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

    <img src="smileys/smiley1.gif" border="0" align="middle" />

    I opened edittime.js:

    "author": "Original work: Zack0Wack0 - LastDataElement modifications by juantar, minify by Johnny Sheffield",

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
604 153,254
aniketraorane's avatar
aniketraorane
Unread hot topic
232 177,663
Tetriser's avatar
Tetriser
Unread hot topic
96 35,939
Chotu's avatar
Chotu