RTC Forums
November 24, 2024, 01:27:36 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: DisconnectNow(True) hang my app  (Read 4673 times)
ISIGest
RTC Expired
*
Posts: 121


« on: May 17, 2016, 11:15:59 AM »

I try to disconnect and reconnect with RtcHttpClient but if I try to call DisconnectNow(True) (or DisconnectNow(false)) the method hang waiting for terminate...but the connection isClosing = true.
There is another method to force closing connection?
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: May 17, 2016, 12:03:46 PM »

Can you send me a simple example Project which demonstrates your problem?


In the E-Mail, please include instructions to reproduce the problem, the Delphi version used to compile the Project and the target platform where this happens.

Best Regards,
Danijel Tkalcec
Logged
ISIGest
RTC Expired
*
Posts: 121


« Reply #2 on: May 17, 2016, 01:43:19 PM »

Now I solved by calling only Disconnect() thank you
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #3 on: May 17, 2016, 02:02:18 PM »

Good.

It is better to use "Disconnect" if you plan to open the connection again. Also, because the "Disconnect" method only signals the component to close the connection, but does NOT wait for the connection to be closed, "Disconnect" method can be used from anywhere, including RTC events triggered by the component.

The "DisconnectNow" method, on the other hand, waits for all RTC events triggered by the component to finish and for the connection to close before continuing, because of which you should NOT use "DisconnectNow" from inside any RTC event triggered by the component, since that would result in an endless loop and is most likely the reason why your Application "hanged".

Best Regards,
Danijel Tkalcec
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 17 queries.