Is there any way to debug xml-rpc controllers (connections)?
Posted: 09 Apr 2013, 22:23
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:
Sent XML: (both str and xml)
Thanks,
~TGY
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;
}
Other output:<?xml version="1.0"?><methodCall><methodName>EnableCallbacks</methodName><params><param><value><boolean>1</boolean></value></param></params></methodCall>
If anyone got an idea why it derps or knows how to see some kind of error, feel free to tell me.len: 153 - -1728053248 -
Thanks,
~TGY