[Gambas-user] Issue 450 in gambas: RpcClient hangs (randomly) and CPU goes to 100% when using timers
gambas at ...2524...
gambas at ...2524...
Tue Jul 9 21:53:16 CEST 2013
Comment #6 on issue 450 by uAle... at ...626...: 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
More information about the User
mailing list