ne0bot / delphionrails

Automatically exported from code.google.com/p/delphionrails
0 stars 0 forks source link

OnMessage event in DLL doesn't reised #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Firstly, thanks for great work. 
I try to use websocket in my libriry, but i have no event.

constructor TMyClass.Create;
begin
  FWebS := TWebSocket.Create;
  FCtx := TSuperRttiContext.Create;
  FWebS.OnMessage:=procedure(const msg: string)
  var
    obj, ret: ISuperObject;
  begin
    obj := SO(msg);
    TrySOInvoke(FCtx, Self, 'ws_' + obj.S['action'], obj, ret);
  end;
  FWebS.Open('ws://echo.websocket.org');

procedure TMyClass.ws_echo(const value: string);
begin
  ShowMessage(value);
end;

procedure TMyClass.SendMessage(msg: string);
begin
  FWebS.Send(SO(['action', 'echo', 'value', msg]).AsString);
end;

When i send message from TMyClass.SendMessage, nothing happense.

Dephi 2010, Win7 x64

What's wrong in my code?

Original issue reported on code.google.com by ad...@simplit.info on 10 Nov 2014 at 11:33