Jump to content

about the new WebSockets


yakup

Recommended Posts

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  BroadcastMessage('SweetAlert',
  [
  'Text', 'my text',
  'Title', 'my Title',
  'TitleText', 'my TitleText'
  ], [boIgnoreCurrentSession])
end;

procedure TMainForm.UniFormBroadcastMessage(const Sender: TComponent;
  const Msg: string; const Params: TUniStrings);
begin
  UniMemo1.Lines.Add(Msg);
  if Msg = 'SweetAlert' then
  begin
    UniSweetAlert1.Title := Params['Title'].AsString;
    UniSweetAlert1.TitleText := Params['TitleText'].AsString;
    UniSweetAlert1.show(Params['Text'].AsString);
  end;
end;

 

i tried in my own project but i can't get broadcast , Isn't it enough to just open it from the server module?

image.png.43c70146c16fa9de70c9b42b479a979d.png

 

Link to comment
Share on other sites

2 minutes ago, Sherzod said:

Use without this.

 

it still doesn't happen. my project is broadcasting on port 1453 I also tried changing the websocket globalport

//  BroadcastMessage('SweetAlert',
//  [
//  'Text', 'my text',
//  'Title', 'my Title',
//  'TitleText', 'my TitleText'
//  ], [boIgnoreCurrentSession])

   BroadcastMessage('SweetAlert',
  [
  'Text', 'my text',
  'Title', 'my Title',
  'TitleText', 'my TitleText'
  ])

 

Link to comment
Share on other sites

36 minutes ago, Sherzod said:

Yes.

WebSocketConnection.Enabled = True

Now i put my own project as dll on iis server.  Didn't work there. 

Since the url is http, I tried it like this, it still didn't work , Do I need an additional setting on the iis server?

image.png.eee52555217040d7e474aed4a9ac1fc5.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...