#1 2016-10-13 19:53:31

jars
Member
Registered: 2015-05-15
Posts: 29

How send a asynchronous message from server with WebSocket

Hi guys.
Using the websocket example (Project31ChatServer and Project31ChatClient) I wish I could send asynchronous messages from the server side to each cliente subscripted to the server.
Is there some example to do that?
Thanks in advance.

Offline

#2 2016-10-14 09:00:37

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Re: How send a asynchronous message from server with WebSocket

Hi,

There are many ways to achive this. Use server jobs with TSynBackgroundThreadProcess to send messages to each WebSocket registered client .

See here : http://synopse.info/files/html/api-1.18 … EADPROCESS

Last edited by turrican (2016-10-14 11:42:11)

Offline

#3 2016-10-14 11:48:42

jars
Member
Registered: 2015-05-15
Posts: 29

Re: How send a asynchronous message from server with WebSocket

Thanks Turrican.
What I need is to identify each client to send several packets to one and others times send the some packets to all clients.

Offline

#4 2016-10-14 12:29:48

turrican
Member
From: Barcelona
Registered: 2015-06-05
Posts: 94
Website

Re: How send a asynchronous message from server with WebSocket

Hi Jars,

If you can match websocket interface with the user sesion at the server side you can achive this easily.

Offline

#5 2016-10-14 17:16:53

jars
Member
Registered: 2015-05-15
Posts: 29

Re: How send a asynchronous message from server with WebSocket

Hi Turrican,
How can I save some data from each client session?

Offline

Board footer

Powered by FluxBB