[r139] WebSocket plugin error

Bugs will be moved here once resolved.

Post » Tue Sep 24, 2013 2:57 am

Link to .capx file (required!):
http://www.mediafire.com/?bbmsl623p53xcj4

Steps to reproduce:
1. I added a textbox and a button.
2. When i set the event On clicked... Connect to txtHost.Text (which is the textbox).
3. When it try to connect to a not available server.. it seem to do this..

Observed result:


Expected result:
No js error message.

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: yes

Operating system & service pack:
Windows 7, latest service pack

Construct 2 version:
r139
   Rushino2013-09-24 02:59:10
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Tue Sep 24, 2013 3:45 am

Just want to add a note.. actually there doesn't seem to have any way to detect if a connection couldnt be established. If we fellow the draft from http://dev.w3.org/html5/websockets/ there are return codes. 1006 should be the returned code for such closure.. however the plugin doesn't allow for getting this value.

This should do the job.. (rest of code not shown.. but easy to figure out)

this.ws.onclose = function (evt_) {
   self.code = evt_.code;
   self.runtime.trigger(cr.plugins_.C2WebSocket.prototype.cnds.OnClosed, self);
};

Also i think i fixed the bug... _err must not be used directly. _err.data must be used. This is still an event like any other event of websockets.

I worked a lots with websockets so i hope ive helped a bit! Rushino2013-09-24 17:38:38
B
16
S
5
G
1
Posts: 190
Reputation: 2,489

Post » Tue Sep 24, 2013 3:46 pm

Did you test in r144.2? We fixed some related issues recently already. I've made some further changes for the next build anyway (added CloseCode and CloseReason expressions; made sure the error message is read properly).

Note: please don't adjust official plugins. It's better to suggest the code changes then allow us to make them through official builds. Anyone using that plugin you provided will now have compatibility difficulties with the official plugin that will come in the next build.
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762

Post » Tue Sep 24, 2013 5:37 pm

Hi Ashley,

Thanks for your reply. Nah, sorry i am rather new here i didn't tried r144.2 because it was a beta version (and i wanted something stable to start on) but to be honest i didn't know changes was made concerning WebSockets in there. Next time i will suggest code instead and have a look at the beta release first :) But thanks for your support!
B
16
S
5
G
1
Posts: 190
Reputation: 2,489


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests