Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Websocket suite

Questions and comments specific to a particular plugin should go here.
Siutsch
Experienced User
Posts: 51
Joined: Wed Apr 28, 2010 6:53 am

Re: Websocket suite

Post by Siutsch »

Thankz.

I will try it.

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

Siutsch.
wuffzack
Posts: 3
Joined: Wed May 23, 2012 3:29 pm

Re: Websocket suite

Post by wuffzack »

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.
Pastis
Posts: 19
Joined: Mon May 16, 2011 3:03 pm

Re: Websocket suite

Post by Pastis »

Wonderful plugin !!! thank you very much :D
Post Reply