我设置了一个 QTcpServer 来监听 Shoutcast 流。newConnection() 信号被触发,因为它应该:
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 ?