Silly me! I've just realized that I should have used the Content-Length HTTP header that the server provides me and read exactly that many bytes.
This was clearly my stupidity but I think there's an actual issue: Medusa should always report some sort of error even if the name or the URL of the RPC call is invalid instead of silently ignoring the request. Is this possible? Should I create a ticket for this? According to the docs it seems to me that the user is expected to use Python and there's no help for other languages, like client-server dialogue examples. Not providing any error messages complicates matters even further. On Thu, Aug 16, 2012 at 1:53 PM, László Monda <l...@monda.hu> wrote: > Thanks a lot for your help, guys. > > Mike, your help almost completely solved my problem. Now I can make > requests and receive responses. Unfortunately, there's a related > annoying issue that I've encountered with: > > When Supervisor sends long XML responses to me and I have to make > multiple reads on the socket the last read blocks. I've tried to set > the socket nonblocking but that resulted in PHP not able to read > anything from the socket. Currently, I set the socket to blocking and > set its timeout to 10 ms and it works but this is an ugly, unstable > hack and I'm interested in how to do it properly. > > It is very likely that I'm not knowleadgable enough about sockets and > this issue doesn't directly pertains to Supervisor. Anyways, I'd > really appreciate if some of you could shed some light on this. > > I attached my code this time. > > On Tue, Aug 14, 2012 at 7:53 PM, Mike Naberezny <m...@maintainable.com> wrote: >> Hi László, >> >> >> On 8/14/12 10:08 AM, László Monda wrote: >>> >>> $xml = xmlrpc_encode_request("getSupervisorVersion", NULL, >>> array('encoding'=>'utf-8')); >> >> >> xmlrpc_encode_request("supervisor.getSupervisorVersion", NULL, >> >> array('encoding'=>'utf-8')); >> >>> $request = 'POST / HTTP/1.1' . $crlf; >> >> >> $request = 'POST /RPC2 HTTP/1.1' . $crlf; >> >> After the two changes above, your code shows the expected XML-RPC response >> when I run it from PHP on the command line. >> >> Regards, >> Mike >> >> -- >> Mike Naberezny >> Maintainable Software >> http://maintainable.com >> >> >> _______________________________________________ >> Supervisor-users mailing list >> Supervisor-users@lists.supervisord.org >> http://lists.supervisord.org/mailman/listinfo/supervisor-users > > > > -- > László Monda <http://monda.hu> -- László Monda <http://monda.hu> _______________________________________________ Supervisor-users mailing list Supervisor-users@lists.supervisord.org http://lists.supervisord.org/mailman/listinfo/supervisor-users