RTC Forums
November 24, 2024, 06:24:50 AM
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
>
Continuos WriteEx in DataReceived Event
Pages: [
1
]
« previous
next »
Print
Author
Topic: Continuos WriteEx in DataReceived Event (Read 4325 times)
ISIGest
RTC Expired
Posts: 121
Continuos WriteEx in DataReceived Event
«
on:
May 02, 2015, 10:45:32 AM »
So, I've an RtcHTTPServer and I need to send continuos data to client afer a request.
I've in CheckRequest event accepted the request and I'va call
WriteHeader(True)
;
In
OnDataReceived
event I've an infinite while that check the buffer and when buffer have data call the "
WriteEx
" procedure...
All work fine but the client does not receive any data. So, I try to call
Flush
metod to force write into connection and after this I clear the response (
Response.Clear
) to re-calculate content length but after first step I got an exception and the connection will be lost.
Can you help me please?
P.S.
I need to make a data flow like a streaming.
Logged
D.Tkalcec (RTC)
Administrator
Posts: 1881
Re: Continuos WriteEx in DataReceived Event
«
Reply #1 on:
May 02, 2015, 11:17:56 AM »
You are trying to force the components to do something they weren't designed for. When sending large amounts of data, you have to split your code to react on the OnDataReceived and OnDataSent events. Do NOT try to write a continuous loop with WriteEx inside the OnDataReceived events, because that will only flood the memory buffers and won't start sending anything out until the event is finished. If you need an example of a correct Server implementation where large amounts of data are being sent out, check Quick Start Server lessons. Especially the Server Lesson 4, which shows you how to send large files by using the WriteEx method to start the sending process and then use the OnDataSent event to continue, until the whole file is sent.
Best Regards,
Danijel Tkalcec
Logged
ISIGest
RTC Expired
Posts: 121
Re: Continuos WriteEx in DataReceived Event
«
Reply #2 on:
May 02, 2015, 01:40:26 PM »
All work very very well...Thank you
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Dashboard
-----------------------------
=> General
=> 3rd-Party
=> Quick Start
-----------------------------
Subscription
-----------------------------
=> Support
Loading...