Thankz.
I will try it.
I am talking mainly about the necessary HTML code ...
Siutsch.
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.
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
Re: Websocket suite
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:
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
which is wrong. IMHO it should be
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.
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()
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)
Code: Select all
#Add client to list:
self.servers[ix][2].append(r)
self.connected.append(r)
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.
Re: Websocket suite
Wonderful plugin !!! thank you very much 