RTC Forums
April 25, 2024, 08:52:47 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: WinHTTP bug ?  (Read 3930 times)
jonb2
Newbie
*
Posts: 36


« on: February 13, 2012, 06:15:19 PM »

Hi D

I have just come across a problem which has been driving me mad.

I notice that with WinHTTP enabled, that above a response size of approx 32k, the data is truncated. Wininet is fine with the same request.

Please can you have a look. I might be wrong.

Cheers

Jo
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: February 13, 2012, 07:20:38 PM »

Works fine for me. I've just downloaded the latest RealThinClient SDK package from this Server (the file is 2.4 MB in size) using the File_Client demo with "WinHTTP" checked. Is it possible that you aren't handling the "OnDataReceived" event correctly? If you can't get it working, I will need to see the source code you are using.

Best Regards,
Danijel Tkalcec
Logged
jonb2
Newbie
*
Posts: 36


« Reply #2 on: February 13, 2012, 07:36:36 PM »

Yes, you are correct. I just solved it by moving the read command to a if TRtcDataClient(Sender).Response.Done check.

Sorry about the false alarm. I am finding the sequence of threads and events quite hard to understand. It would be great if there was a sequence flow diagram of the events when threaded.

Also, I am unsure what the blocking option does to this event chain? As far as I can tell, it simply disallows any asynchronous actions. So should speed things up.

Thanks again for your quick response Danijel.

Jon

 
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: February 13, 2012, 08:05:38 PM »

All events from a single connection are always executed in the same sequence, regardless wether you are using threads or not.

I think what might be somewhat confusing, is that the OnDataReceived event will be fired immediately when the response starts coming in and again (and again, and ... ) as long as more data is arriving for that request/response sequence (and not only once for the complete request/response).

The same goes for sending data out. The "OnDataSent" event will be called every time all the prepared data from the sending buffer is sent, so you can split the sending process in as big or as little packets as you want.

As for the "blocking" property, it defines what kind of API will be used. On Windows, the RTC SDK supports asynchronous WinSock, blocking WinSock, blocking WinInet and blocking WinHTTP APIs. On MacOSX and iOS, the RTC SDK supports blocking BSD sockets as well as emulated non-blocking BSD sockets (using threads). And ... you can use them all with MultiThreaded=True, in which case all the events will be executed from background threads and your main thread won't be blocked even when using a blocking API.

For you, it should not matter much which API is being used if you implement your code correctly.

Best Regards,
Danijel Tkalcec
Logged
jonb2
Newbie
*
Posts: 36


« Reply #4 on: February 15, 2012, 12:09:17 PM »

Thanks again D  Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 16 queries.