Is there any way to debug xml-rpc controllers (connections)?

Moderators: Xymph, NADEO

Post Reply
User avatar
TGYoshi
Posts: 795
Joined: 15 Mar 2011, 16:59

Is there any way to debug xml-rpc controllers (connections)?

Post by TGYoshi »

I'm trying to code an xml-rpc controller thingy, but because I don't seem to follow the correct protocol the server gets mad at me and closes the connection (winsock error 10054).
Is there any way to find out WHY it closes the connection? It just drops me off and I'm kinda lost now.
The handshake works fine, but when I call a method it starts derping.

If anyone wants to look at it anyway;

This code causes it:

Code: Select all

void sendMethod(string xml) {
	char *str = (char*)xml.c_str();
	int x = (int)strlen(str);
	int x2 = htonl(x);
	int y = 1;
	int y2 = htonl(y);

	send( ConnectSocket, (char*)&x2, 4, 0 );
	send( ConnectSocket, (char*)&y2, 4, 0 );
	send( ConnectSocket, str, x, 0 );
	cout << str << endl;
	cout << "len: " << x << " - " << x2 << " - " << endl;
	cout << "Sent!" << endl;
}
Sent XML: (both str and xml)
<?xml version="1.0"?><methodCall><methodName>EnableCallbacks</methodName><params><param><value><boolean>1</boolean></value></param></params></methodCall>
Other output:
len: 153 - -1728053248 -
If anyone got an idea why it derps or knows how to see some kind of error, feel free to tell me.

Thanks,

~TGY
=3
Speljohan
Posts: 2
Joined: 06 Apr 2013, 14:47

Re: Is there any way to debug xml-rpc controllers (connectio

Post by Speljohan »

I don't see any references to actually packing the xml data, that's probably what you're missing :) The protocol employed for this is actually wrongfully referred to as xml-rpc, when in reality it breaks half of the official spec.
User avatar
TGYoshi
Posts: 795
Joined: 15 Mar 2011, 16:59

Re: Is there any way to debug xml-rpc controllers (connectio

Post by TGYoshi »

Fixed it, setting the rechandle param to 0x80000000 + 1 did the job.
A night of sleep seems to help a lot.
=3
Post Reply

Return to “General Tools”

Who is online

Users browsing this forum: No registered users and 1 guest