RTC Forums
November 24, 2024, 02:57:12 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Login
Register
RTC Forums
>
Subscription
>
Support
>
A Question about using raw components
Pages: [
1
]
« previous
next »
Print
Author
Topic: A Question about using raw components (Read 6097 times)
levi
Newbie
Posts: 4
A Question about using raw components
«
on:
February 17, 2014, 02:03:11 AM »
Hello:
I have a project.
In it, I have to mark every connection of client,So I can send binary message to a certain client.
Another mater I have is :
How can I loop the Client connections and send message to all!
How can I loop the Client connections and find a certain Client, then send message to it.
I seach it on the forums, I found none.
Best Regards!
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: A Question about using raw components
«
Reply #1 on:
February 17, 2014, 09:10:14 AM »
You need to use the OnConnect event to store the "Sender:TRtcConnection" component in your own connection list, and use the "OnDisconnect" event to remove the component from the list. The OnConnect event is triggered when a connection is successfully established and you get the connection component as "Sender" parameter. The OnDisconnect event is triggered when a connection is closing and you also get the connection component as a "Sender" parameter there.
If your Server will be Multi-Threaded (set MultiThreaded property to True):
1. Use critical sections to secure access to your connection components list
2. Only call the "Read" or "ReadEx" methods from the OnDataReceived event
3. Use the "PostEvent" method (on the Sender:TRtcConnection component) when you need to send data to the Client or the Server. Only call the "Write" or "WriteEx" methods from within the event called by "PostEvent". Do NOT call "Write" or "WriteEx" from any ther place.
Best Regards,
Danijel Tkalcec
Logged
levi
Newbie
Posts: 4
Re: A Question about using raw components
«
Reply #2 on:
February 17, 2014, 02:37:25 PM »
Thanks.
Logged
levi
Newbie
Posts: 4
Re: A Question about using raw components
«
Reply #3 on:
February 19, 2014, 12:37:12 PM »
I Test this work well.
Thanks!
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: A Question about using raw components
«
Reply #4 on:
February 19, 2014, 12:52:22 PM »
Thanks for your feedback.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Dashboard
-----------------------------
=> General
=> 3rd-Party
=> Quick Start
-----------------------------
Subscription
-----------------------------
=> Support
Loading...