Use of websockets in remobjects elements / oxygene

(Werner Pick-Noteborn) #1

Hi there,
i have to build a software with remobjects elements / oxygene, that uses a websocket. I’ve found a sample in c# and i translated it with the oxidizer. When i build the solution, i get an error ‘(E266) Cannot access underlying field to raise event “websocket.MessageReceived”’.
Is there a documentation / howto / sample-solution that i can use to solve my problem?
Regards Werner

(marc hoffman) #2

That sounds like Oxidizer probably just got the syntax slightly wrong here. Anything that works in C#, the same concepts will work in oxygene as well.

Can you post the relevant biota code, in original and the translation?

(Werner Pick-Noteborn) #3

Hi Marc,

c# source(for example) is:

        websocket.MessageReceived += new EventHandler<MessageReceivedEventArgs>(websocket_MessageReceived);

oxidizer delivers:

        websocket.MessageReceived { NOT SUPPORTED } new EventHandler<MessageReceivedEventArgs>(websocket_MessageReceived);

i’ve corrected oxidizer to:

websocket.MessageReceived += new EventHandler<MessageReceivedEventArgs>(@websocket_MessageReceived);

and now it works!


(marc hoffman) #4

Ok, that does sound like an Oxidizer bug, i’ll log.

FTR, this simpler version should also work:

websocket.MessageReceived += websocket_MessageReceived;

(RemObjects) #5

Thanks, logged as bugs://78545

(RemObjects) #6

bugs://78545 got closed with status fixed.