Websocket suite

Questions and comments specific to a particular plugin should go here.

Re: Websocket suite

Postby Siutsch » Wed Apr 25, 2012 4:27 pm

Thankz.

I will try it.

I am talking mainly about the necessary HTML code ...

Siutsch.
Siutsch
 
Posts: 43
Joined: Wed Apr 28, 2010 6:53 am

Re: Websocket suite

Postby wuffzack » Wed May 23, 2012 3:50 pm

Hi all,

I have found 2 serious bugs within the Websocket suite, and I believe I have fixed them. I just want to share my findings, so Pako can make this wonderful plugin even better.

Bug 1:
If there is an error during protocol negotiation, the server handler thread will run in a loop eating 100% of CPU time (or at least of one core).
Solution:
In line 3144 there is this statement:
if prot is not None: #CONNECT ?
In case prot *is* None, this code should be executed:
Code: Select all
                            else:
                                eg.PrintError('Websocket: prot is None! This is bad!')
                                del self.clientsServers[r]
                                self.inputs.remove(r)
                                r.close()


Bug 2:
If a client accidentally connects twice to the server and then disconnects, the plugin will crash badly. Eventghost needs to be restarted. This can happen in real life easily (moving out of range of a WLAN and entering again), but can be provoked by opening the websocket twice from a client.

line 3145 reads
Code: Select all
                                #Add client to list:
                                self.servers[ix][2].append(connection)
                                self.connected.append(r)

which is wrong. IMHO it should be
Code: Select all
                                #Add client to list:
                                self.servers[ix][2].append(r)
                                self.connected.append(r)

Otherwise the wrong socket is added to the list and havoc strikes as soon as a non existing socket tries to disconnect.
I don't understand the code well enough to be 100% sure, but these changes solved all reliability problems so far.

I hope this information is useful.
Many thanks to Pako for this incredibly useful plugin.
wuffzack
 
Posts: 2
Joined: Wed May 23, 2012 3:29 pm

Re: Websocket suite

Postby Pastis » Sun Mar 10, 2013 12:31 pm

Wonderful plugin !!! thank you very much :D
Pastis
 
Posts: 16
Joined: Mon May 16, 2011 3:03 pm

Previous

Return to Plugin Support

Who is online

Users browsing this forum: Google Adsense [Bot] and 5 guests