1
我設置了一個QTcpServer來監聽Shoutcast流。 newConnection() - 信號被觸發,因爲它應該:QTcpServer:發送HTTP/1.0 200 OK連接客戶端
connect(tcpServer, SIGNAL(newConnection()), this, SLOT(handleClientComm()));
void IcecastServer::handleClientComm(){
QTcpSocket *clientConnection = tcpServer->nextPendingConnection();
qDebug() << clientConnection->write("HTTP/1.0 200 OK\r\n\r\n") << endl;
clientConnection->flush();
}
如何發送HTTP 200?
謝謝。它現在起作用,我不得不刪除換行符之間的空格。 – Hedge 2011-04-15 07:44:57