Subject Re: Error in websocket
From Boris Borzic <bb> <Boris Borzic <bb>>
Date Wed, 19 Jun 2019 14:55:07 +0200
Newsgroups xb2net

Robert Diaz <> wrote in news:g3s3ak5nsatnyva.190620191318@daz17:

>> > The most likely reason for the error is your code is not
>> > thread-safe. The websocket function is executing code in a
>> > different thread from the GUI components. You need to create some
>> > type of mutex.
>>
>> How to create mutex in my function? Shall i get some samples?
>
>  My socket object(osock) is instance of xbwebsocket class,i think it's
>  not thread safe. Do I need to change it to xbsocketThread class ?How
>  i will do that?Any example program using this class?

The problem is *NOT* in xbWebSocket. The problem is in the way you are
using it!

Suggest your read up on the "Multi-tasking and Multi-threading" + "Mutual
exclusion of threads" in Xbase++ documentation.

The GUI components in Xbase++ run in their own independent thread. It looks
like you are manipulating the Xbase++ GUI components from different
threads. This is likely what is causing the error. It also begs the
question why you need to have a GUI on the server-side.

Server applications should be as simple as possible! Most run as a windows
service with no direct GUI. A user interface for the service is usually
provided through a secondary helper application or via a web browser.

--
Best regards,
Boris Borzic

http://xb2.net
http://sqlexpress.net
industrial strength Xbase++ development tools

Recent messages in this thread
 
-# Error in websocket Robert Diaz <> 28-May-2019 03:30 am
.-# Re: Error in websocket Boris Borzic <bb> 28-May-2019 10:03 am
..-# Re: Error in websocket Robert Diaz <> 29-May-2019 01:40 am
...-# Re: Error in websocket Boris Borzic <bb> 29-May-2019 09:53 am
....-# Re: Error in websocket Robert Diaz <> 17-Jun-2019 01:28 am
.....-# Re: Error in websocket Boris Borzic <bb> 17-Jun-2019 09:43 am
......-# Re: Error in websocket Robert Diaz <> 19-Jun-2019 12:50 am
.......-# Re: Error in websocket Robert Diaz <> 19-Jun-2019 07:18 am
........\# Re: Error in websocket (Current message) Boris Borzic <bb> 19-Jun-2019 08:55 am