Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > d38b97c69a3fd47b351add70f89a7ab5 > files > 657

perl-qt4-examples-4.14.3-1.mga5.noarch.rpm

package Server;

use strict;
use warnings;
use QtCore4;
use QtGui4;
use QtNetwork4;
use QtCore4::isa qw( Qt::TcpServer );
use QtCore4::signals
    newConnection => ['QTcpSocket*'];
use Connection;

sub NEW
{
    my ($class, $parent) = @_;
    $class->SUPER::NEW($parent);
    this->listen(Qt::HostAddress(Qt::HostAddress::Any()));
}

sub incomingConnection
{
    my ($socketDescriptor) = @_;
    my $connection = Connection(this);
    $connection->setSocketDescriptor($socketDescriptor);
    emit newConnection($connection);
}

1;