示例#1
0
ServeurTcpPull::ServeurTcpPull( const QString& pathFlux, int port):
    QTcpServer()
{
    chargerVideo( pathFlux );
    connect(this, SIGNAL(newConnection()),
            this, SLOT(connexionAuServeur()) );

    listen( QHostAddress::Any, port );
    waitForNewConnection();
    //attend une connection
}
ServeurUdpPull::ServeurUdpPull(): QTcpServer()
{
    sockecoute = new QUdpSocket;
    chargerVideo();
    sockecoute->bind(QHostAddress::Any, 11114, QUdpSocket::ShareAddress);
    //sock lié au port de 11114 ecoutant depuis toutes les adresses
    // et plusieurs a la fois
    connect(sockecoute, SIGNAL(readyRead()), this, SLOT(requeteRecu()));

    waitForNewConnection();

    //attend une connection
}