Hey everyone, I'm back from camping and development will now resume.
I'm starting to implement the flash (r63) protocol, but I've hit an odd problem very early on. I've also almost finished implementing room search, then I'm moving on to private room categories.
The issue I'm having with the Flash client is nothing happens after I send the cross-domain policy. I remember there being some sort of weird disconnect-reconnect thing when I was programming my Java connection API, but I can't seem to figure out how it actually works. I've looked through the Uber source, and it doesn't seem to be doing anything special here.
Here is the current source of flashclient.cpp, it should give you a look into the problem:
PHP Code:
#include "flashclient.h"
#include <QTcpSocket>
FlashClient::FlashClient(QObject *parent, QTcpSocket* sock) :
QObject(parent) {
socket = sock;
socket->setParent(this); // change the parent so when this client is detroyed, the socket goes with it
connect(sock, SIGNAL(readyRead()), this, SLOT(gotPacket()));
connect(sock, SIGNAL(disconnected()), this, SLOT(deleteLater()));
}
void FlashClient::gotPacket() {
buffer += socket->read(socket->bytesAvailable());
//qDebug() << "CLIENT->SERVER: " << packet << "\n";
printf("FLC: %s\n", QString(buffer).toStdString().c_str());
if(buffer.at(0) == '<'){
QString CDMP = QString("<?xml version=\"1.0\"?>\r\n<!DOCTYPE cross-domain-policy SYSTEM \"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd\"><cross-domain-policy>\r\n<allow-access-from domain=\"*\"/>\r\n</cross-domain-policy>\r\n\001");
socket->write(CDMP.toStdString().c_str());
socket->flush();
//socket->close(); // disconnecting the client doesn't help
printf("Sent policy file!\n");
}
}
The client requests the policy file, the server sends it, then nothing.
If anyone knows anything about how the flash client handles the cross-domain policy crap, let me know!