Comment #6 on issue 450 by [email protected]: RpcClient hangs (randomly)  
and CPU goes to 100% when using timers
http://code.google.com/p/gambas/issues/detail?id=450

Ok, I think i found the reason why it isn't work.

The RpcClient can send a request in Async or Sync mode. I think this is  
normally passed on via the hPost towards the HttpClient.c & CCurl.c. In  
Async mode the "_Finished", "_Read" and "_Error" events are raised. In Sync  
mode none of these events are raised.

I noticed the following behavior:
- "gb.xml/src/rpc/gb.xml.rpc/.src/RpcClient.class" sets it to sync mode
- "gb.xml/src/rpc/gb.xml.rpc/.src/hPost.class" sets it to sync mode
- Only this is NEVER propagated to the HttpClient.Async value
-  "./gb.net.curl/src/CHttpClient.c" still thinks it is in async mode

Depending on timing issues, this combination can cause 100% CPU load. The  
HttpClient sends a "_Read" event, but in the hPost.class due to the  
mismatch in Modes, it *never* reads the socket and it goes into an endless  
loop.

The following looks to have fixed it for me, modify  
the "gb.xml/src/rpc/gb.xml.rpc/.src/hPost.class":

Public Function PostData(Data As String) As String

   Dim sCad As String

   Buffer = ""
   sCad = ""
   Http.Post("text/xml", Data)

=== To: ===

Public Function PostData(Data As String) As String

   Dim sCad As String

   Buffer = ""
   sCad = ""
   Http.Async = Mode
   Http.Post("text/xml", Data)

ps. i didn't try to commit it into the SVN, because I don't know if my  
analysis (and fix) is correct.

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to