SlideShare a Scribd company logo
1 of 23
Download to read offline
ECOSYSTEM


1   INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
QtNetwork explained




2   INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
TÓPICOS
    • Introdução ao QtNetwork
    • Por que usar QtNetwork
    • Sockets
       ●
         QAbstractSocket
           ●
                 QTcpSocket
                    –     QsslSocket
           ●
                 QTcpServer
           ●
                 QudpSocket
                    –     Broadcast
                    –     Multicast (somente 4.8 !symbian)
3   INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
TÓPICOS
    • High level networking
       ●
         QnetworkAccessManager
            ●
                   QnetworkConfiguration
            ●
                   QnetworkConfigurationManager
            ●
                   QnetworkSession
            ●
                   QnetworkRequest
            ●
                   QNetworkReply




4   INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
Introdução ao QtNetwork
 • QtNetwork é um módulo do Qt
 • Provê uma interface cross platforma para escrever aplicações
   cliente servidor TCP/IP
 • Suporta proxy
 • Possui classes para realizar requests http e ftp, acessar web
   services e tratar suas respostas.
 • Pegar informações sobre dispositivos de rede
 • É possível ainda gerenciar o estado de conexão com a rede, ter
   configurações específicas para cada uma e realizar ações.
Por que usar QtNetwork?
int main()
{
                                                                  int main()
  int fd = socket(AF_INET, SOCK_STREAM, 0);                       {
  if (fd == 1)
  {                                                                 QCoreApplication app(argc, argv);
    printf("can not create socket");
    exit(1);
  }                                                                   QTcpServer server;
  struct sockaddr_in saddr;
  bzero(&saddr, sizeof(saddr));
                                                                      server.listen(QHostAddress::Any, 1100);
  saddr.sin_family = AF_INET;
  saddr.sin_port = htons(1100);
  saddr.sin_addr.s_addr = htonl(INADDR_ANY);
                                                                      while (server.waitForNewConnection()) {
                                                                        do {
    if (bind(fd,(struct sockaddr *)&saddr, sizeof(saddr)) == 1)
    {                                                                      QTcpSocket *socket = server.nextPendingConnection();
      printf("error bind failed");                                         socket->write(“Hello, world!”);
      exit(1);
    }                                                                      socket->disconnectFromHost();
    if (listen(fd, 10) == 1)
                                                                           socket->waitForDisconnected();
    {                                                                      delete socket;
      printf("error listen failed");
      exit(1);
                                                                        } while (server.hasPendingConnections());
    }                                                                 }
    for(;;) {
      int connfd = accept(fd, NULL, NULL);                        }
      if(connfd <= 0) {
        printf("error accept failed");
        exit(1);
      }

        write(connfd, "Hello world!n", 13);
        close(connfd);
    }

    return 0;
}
Sockets: QAbstractSocket

    • QabstractSocket é uma camada de abstração multi
      plataforma para api nativa de network
    • Implementa TCP, UDP e sockets locais
    • Herda de QIODevice




7   INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
Sockets: QTcpSocket
 ●
     Subclasse de conveniência do QAbstractSocket
 ●
     Pode ser utilizado pra implementar vários tipos
     protocolos
 ●
     Stream de dados contínuo
 ●
     Poder ser usado de maneira asíncrona ou síncrona.
Sockets: QTcpSocket
                                                                  ClientSocket::ClientSocket(QObject *parent)
ServerSocket::ServerSocket(QObject *parent)                           : QTcpSocket(parent)
  : QTcpSocket(parent)                                            {
{                                                                     connect(this, SIGNAL(readyRead()),
  connect(this, SIGNAL(readyRead()),
                                                                              this, SLOT(onReadyRead()));
      this, SLOT(onReadyRead()));
}
                                                                      connect(this, SIGNAL(disconnected()),
void ServerSocket::onServerInfoResponse(const QVariantMap &map)               this, SLOT(onDisconnected()));
{
  QJson::Serializer serializer;                                       connect(this, SIGNAL(error(QAbstractSocket::SocketError)),
                                                                              this, SLOT(onError(QAbstractSocket::SocketError)));
    write(serializer.serialize(map));
                                                                  }

    flush();
}                                                                 void ClientSocket::onDisconnected()
                                                                  {
void ServerSocket::onServerStatusChanged(const QString &status)       qDebug() << "[ClientSocket] Client disconnected!";
                                                                  }
{
    QVariantMap map;
                                                                  void ClientSocket::onError(QAbstractSocket::SocketError error)
    map["what"] = "server";
                                                                  {
    map["action"] = "statusChanged";
    map["status"] = status;                                           qDebug() << "[ClientSocket] Error: " << error;
                                                                  }
    QJson::Serializer serializer;
    write(serializer.serialize(map));                             void ClientSocket::requestServerInfo()
    flush();                                                      {
}                                                                     QVariantMap map;
                                                                      QJson::Serializer serializer;
void ServerSocket::onReadyRead()
{
  while (canReadLine()) {                                             map["what"] = "server";
    QByteArray line = readLine();                                     map["action"] = "serverInfo";


                                                                      write(serializer.serialize(map)");
        bool parserOk = true;                                     }
        QJson::Parser parser;
                                                                  void ClientSocket::onQJsonParsingFinished(const QVariant &json, bool ok, const QString &error_msg)
        QVariant var = parser.parse(line, &parserOk);
                                                                  {
        if (!parserOk) {                                              if (!ok) {
           qWarning()                                                     qWarning() << Q_FUNC_INFO << "json error at" << error_msg;
                   << Q_FUNC_INFO                                         return;
                   << "json error at"                                 }
                   << parser.errorLine()
                   << parser.errorString();                           QVariantMap map = json.toMap();
        } else {
                                                                      QString what = map["what"].toString();
           QVariantMap map = var.toMap();
                                                                      if (what == "server") {
           QString what = map["what"].toString();
           if (what == "server") {                                        QString action = map["action"].toString();
              QString action = map["action"].toString();                  if (action == "serverInfo") {
              if (action == "info") {                                         emit serverInfoReceived(map);
                 emit serverInfoRequested();                              }
              }                                                       }
           }
                                                                  }
        }
    }
}
Sockets: QTcpServer
 ●
     Precisa receber conexões? Essa é a classe certa.
 ●
     Pode ser single threaded or multi threaded
 ●
     Single threaded
     ●
         Um ou vários sockets usando mesmo Event loop
     ●
         Ou Bloqueante
 ●
     Multi threaded
     ●
         Um socket por thread
          –   Bloqueante
          –   Ou um Event loop por thread
Sockets: QTcpServer
Server::Server(QObject *parent)
  : QtcpServer(parent)
  , m_serverInfo()
{
}

void Server::start()
{
  listen(QHostAddress::Any, 12345);
}

void Server::incomingConnection(int socketDescriptor)

{
    ServerSocket *sock = new ServerSocket;
    sock->setSocketDescriptor(socketDescriptor);
    QThread *thread = new QThread;
    sock->moveToThread(thread);

    connect(sock, SIGNAL(disconnected()),
        sock, SLOT(deleteLater()));
    connect(sock, SIGNAL(destroyed()),
        thread, SLOT(quit()));
    connect(thread, SIGNAL(finished()),
        thread, SLOT(deleteLater()));

    connect(this, SIGNAL(statusChanged(const Qstring &)),
        sock, SLOT(onServerStatusChanged(const Qstring &)));

    connect(sock, SIGNAL(serverInfoRequested()),
        this, SLOT(onServerInfoRequested()));

    thread->start();
}

void Server::onServerInfoRequested()
{
  ServerSocket *sock = qobject_cast<ServerSocket*>(sender());
  if (!sock)
     return;

    QMetaObject::invokeMethod(sock, "onServerInfoResponse",
                Q_ARG(QVariantMap, m_serverInfo));
}
Sockets: QudpSocket Broadcast
BroadcastAnnounce::BroadcastAnnounce(QObject *parent)
    : QObject(parent)
    , m_socket(new QUdpSocket(this))
    , m_timer(new QTimer(this))
    , m_serverInfo()
{
    connect(m_timer, SIGNAL(timeout()), this, SLOT(sendDatagram()));
}


void BroadcastAnnounce::start()
{
    if (m_timer->isActive())
      m_timer->stop();


    m_timer->start(1000);
}


void BroadcastAnnounce::stop()
{
    m_timer->stop();
}
void BroadcastAnnounce::setServerInfo(const QVariantMap &map)
{
    m_serverInfo = map;
}
void BroadcastAnnounce::sendDatagram()
{
    QByteArray datagram;
    QDataStream out(&datagram, QIODevice::WriteOnly);
    out.setVersion(QDataStream::Qt_4_7);
    out << QVariant(m_serverInfo);
 m_socket->writeDatagram(datagram.data(), datagram.size(), QHostAddress::Broadcast,
UDP_PORT);
}
Sockets: QudpSocket Broadcast
BroadcastAnnounce::BroadcastAnnounce(QObject *parent)                                 BroadcastDiscover::BroadcastDiscover(QObject *parent)
                                                                                          : QObject(parent)
    : QObject(parent)                                                                     , m_socket()
                                                                                          , m_timer(new QTimer(this))
    , m_socket(new QUdpSocket(this))
                                                                                      {
    , m_timer(new QTimer(this))                                                           connect(m_timer, SIGNAL(timeout()), this, SLOT(stop()));
                                                                                      }
    , m_serverInfo()
{                                                                                     void BroadcastDiscover::start()
                                                                                      {
    connect(m_timer, SIGNAL(timeout()), this, SLOT(sendDatagram()));
                                                                                          m_socket = new QUdpSocket(this);
}                                                                                         m_socket->bind(UDP_PORT, QUdpSocket::ShareAddress);
                                                                                          connect(m_socket, SIGNAL(readyRead()),
                                                                                                  this, SLOT(processDatagrams()));
void BroadcastAnnounce::start()                                                           m_timer->start(10000);
                                                                                      }
{
    if (m_timer->isActive())                                                          void BroadcastDiscover::stop()
                                                                                      {
      m_timer->stop();                                                                    disconnect(m_socket, SIGNAL(readyRead()),
                                                                                                      this, SLOT(processDatagrams()));
                                                                                          m_socket->close();
    m_timer->start(1000);                                                                 emit timeout();
}                                                                                     }


                                                                                      void BroadcastDiscover::processDatagrams()
void BroadcastAnnounce::stop()                                                        {
                                                                                          QUdpSocket *socket = qobject_cast<QUdpSocket *>(sender());
{                                                                                         if (!socket)

    m_timer->stop();                                                                          return;

}                                                                                         while (socket->hasPendingDatagrams()) {
                                                                                              QByteArray datagram;
void BroadcastAnnounce::setServerInfo(const QVariantMap &map)
                                                                                              QHostAddress host;
{
                                                                                              datagram.resize(socket->pendingDatagramSize());
    m_serverInfo = map;
                                                                                              socket->readDatagram(datagram.data(), datagram.size(), &host);
}
                                                                                              QVariant message;
void BroadcastAnnounce::sendDatagram()
                                                                                              QDataStream dataStream(&datagram, QIODevice::ReadOnly);
{                                                                                             dataStream >> message;

    QByteArray datagram;
                                                                                              const QVariantMap map = message.toMap();
    QDataStream out(&datagram, QIODevice::WriteOnly);                                         if (map["app_id"].toString() == APP_ID) {
                                                                                                  const QString action = map["action"].toString();
    out.setVersion(QDataStream::Qt_4_7);                                                          if (action == "serverAnnounce") {
    out << QVariant(m_serverInfo);                                                                    emit serverFound(map);
                                                                                                  }
 m_socket->writeDatagram(datagram.data(), datagram.size(), QHostAddress::Broadcast,           }
UDP_PORT);                                                                                }
}                                                                                     }
Sockets: QudpSocket Multicast
MulticastAnnounce::MulticastAnnounce(QObject *parent)                                                     MulticastDiscover::MulticastDiscover(QObject *parent)
                                                                                                              : QObject(parent)
    : QObject(parent)                                                                                         , m_socket()
    , m_socket(new QUdpSocket(this))                                                                          , m_timer(new QTimer(this))
                                                                                                          {
    , m_timer(new QTimer(this))
                                                                                                              connect(m_timer, SIGNAL(timeout()), this, SLOT(stop()));
    , m_serverInfo()                                                                                      }
{
                                                                                                          void MulticastDiscover::start()
    connect(m_timer, SIGNAL(timeout()), this, SLOT(sendDatagram()));
                                                                                                          {
                                                                                                              m_socket = new QUdpSocket(this);

    m_socket->setSocketOption(QAbstractSocket::MulticastTtlOption, 1);                                        m_socket->bind(UDP_PORT, QUdpSocket::ShareAddress);
                                                                                                              m_socket->joinMulticastGroup(QHostAddress("239.255.43.21"));
}
                                                                                                              connect(m_socket, SIGNAL(readyRead()),
                                                                                                                      this, SLOT(processDatagrams()));
void MulticastAnnounce::start()
                                                                                                              m_timer->start(10000);
{                                                                                                         }
    if (m_timer->isActive())
                                                                                                          void MulticastDiscover::stop()
      m_timer->stop();                                                                                    {
                                                                                                              disconnect(m_socket, SIGNAL(readyRead()),
                                                                                                                          this, SLOT(processDatagrams()));
    m_timer->start(1000);
                                                                                                              m_socket->close();
}                                                                                                             emit timeout();
                                                                                                          }

void MulticastAnnounce::stop()
                                                                                                          void MulticastDiscover::processDatagrams()
{                                                                                                         {
    m_timer->stop();                                                                                          QUdpSocket *socket = qobject_cast<QUdpSocket *>(sender());
                                                                                                              if (!socket)
}                                                                                                                 return;


                                                                                                              while (socket->hasPendingDatagrams()) {
void MulticastAnnounce::setServerInfo(const QVariantMap &map)
                                                                                                                  QByteArray datagram;
{                                                                                                                 QHostAddress host;
    m_serverInfo = map;
                                                                                                                  datagram.resize(socket->pendingDatagramSize());
}
                                                                                                                  socket->readDatagram(datagram.data(), datagram.size(), &host);


void MulticastAnnounce::sendDatagram()                                                                            QVariant message;
                                                                                                                  QDataStream dataStream(&datagram, QIODevice::ReadOnly);
                                                                                                                  dataStream >> message;
{
    QByteArray datagram;                                                                                          const QVariantMap map = message.toMap();
                                                                                                                  if (map["app_id"].toString() == APP_ID) {
    QDataStream out(&datagram, QIODevice::WriteOnly);
                                                                                                                      const QString action = map["action"].toString();
    out.setVersion(QDataStream::Qt_4_8);                                                                              if (action == "serverAnnounce") {
    out << QVariant(m_serverInfo);                                                                                        emit serverFound(map);
                                                                                                                      }
                                                                                                                  }
    m_socket->writeDatagram(datagram.data(), datagram.size(), QHostAddress("239.255.43.21"), UDP_PORT);       }
                                                                                                          }
}
Sockets: QUdpSocket
 ●
     Subclasse de conveniência do QabstractSocket para
     UDP
 ●
     Envio de pacotes de dados ao invés de stream
     contínuo
 ●
     Possui suporte a Broadcast
 ●
     Desde o Qt 4.8 suporte a Multicast
QnetworkConfigurationManager
1- Definir o Ponto de Acesso

QNetworkConfigurationManager manager;

//Define que o usuário pode escolher um ponto de acesso

const bool canStartIAP = (manager.capabilities()&
QnetworkConfigurationManager::CanStartAndStopInterfaces);

//Retorna a configuração padrão atual

manager.defaultConfiguration();




         16
                INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
QnetworkConfiguration
1- Definir o Ponto de Acesso

QNetworkConfigurationManager manager;

//Define que o usuário pode escolher um ponto de acesso

const bool canStartIAP = (manager.capabilities()&
QNetworkConfigurationManager::CanStartAndStopInterfaces);

//Se existe um ponto de acesso padrao. Basta utiliza-lo usando
a configuracao padrao do QNetWorkConfigurarionManager

QNetworkConfiguration cfg = manager.defaultConfiguration();

if (!cfg.isValid() || !canStartIAP) {

// Pontos de acesso nao encontrados ou impossivel se
conectar

// Alertar usuario e fazer tratamento de erro

return;

}




           17
                   INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
QnetworkSession
// Caso a conexao tenha ocorrido com sucesso, abrir um
QNetworkSession usando a configuracao padrao

m_session = new QNetworkSession(cfg);

//Conectar sinais necessarios

connect(m_session, SIGNAL(closed()), this, SLOT(closed()));

connect(m_session,
SIGNAL(stateChanged(QNetworkSession::State)), this,
SLOT(stateChanged(QNetworkSession::State)));

connect(m_session,
SIGNAL(error(QNetworkSession::SessionError)), this,
SLOT(error(QNetworkSession::SessionError)));

Abrir aconexao

m_session->open();

// Espera a sessão ser aberta e continua a partir dai

m_session->waitForOpened();

Para fechar a sessão, usar o slot finished()




         18
                 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
QnetworkAccessManager
1- Criar um Network Access Manager

nam = new QNetworkAccessManager(this);

2- Conectar o sinal finished a um slot para tratar o resultado

QObject::connect(nam, SIGNAL(finished(QNetworkReply*)),

    this, SLOT(finishedSlot(QNetworkReply*)));




         19
                INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
QnetworkRequest
1- Criar um Network Access Manager

nam = new QNetworkAccessManager(this);

2- Conectar o sinal finished a um slot para tratar o resultado

QObject::connect(nam, SIGNAL(finished(QNetworkReply*)),

    this, SLOT(finishedSlot(QNetworkReply*)));

3- Criar o Request

QUrl url(http://query.yahooapis.com/v1/public/yql);

url.addQueryItem(QUERY_PARAM,

QLatin1String("select+*+from+geo.placefinder+where+text="")

+ "Sao Paulo" + QLatin1String("""));

url.addQueryItem("format", "json");

QnetworkRequest request(url);




         20
                INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
QNetworkReply
1- Criar um Network Access Manager

nam = new QNetworkAccessManager(this);

2- Conectar o sinal finished a um slot para tratar o resultado

QObject::connect(nam, SIGNAL(finished(QNetworkReply*)),

    this, SLOT(finishedSlot(QNetworkReply*)));

3- Criar o Request

QUrl url(http://query.yahooapis.com/v1/public/yql);

url.addQueryItem(QUERY_PARAM,

QLatin1String("select+*+from+geo.placefinder+where+text="")

+ "Sao Paulo" + QLatin1String("""));

url.addQueryItem("format", "json");

QnetworkRequest request(url);

4- Guardar o reply do request par ser usado como identificador da resposta

QNetworkReply* reply = nam->get(request)




         21
                INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
QNetworkReply
4- Tratar o Reply

void MyHttpEngine::finishedSlot(QNetworkReply* reply) {

        // Ler Atributos do Repply como ocodigo de Status HTTP

        QVariant statusCodeV = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);

void MyHttpEngine::finishedSlot(QNetworkReply* reply) {

        // Ler Atributos do Repply como o codigo de Status HTTP

        QVariant statusCodeV = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);

        // Ou a URL, se esta tiver sido redirecionada:

        QVariant redirectionTargetUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);

        // Verificar se houve erro

        if (reply->error() == QnetworkReply::NoError) {

          // Se nao houve erro, ler os dados da resposta

          //Ex1: Criando um QImage da resposta

          QImageReader imageReader(reply);

          QImage pic = imageReader.read();

    }

}




                 22
                         INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
Canais de comunicação
• @nokiadev_brasil
• rodrigo.belem@openbossa.org




 23   INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]

More Related Content

What's hot

FwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.jsFwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.jsTimur Shemsedinov
 
Building Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDBBuilding Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDBMongoDB
 
Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++corehard_by
 
[grcpp] Refactoring for testability c++
[grcpp] Refactoring for testability c++[grcpp] Refactoring for testability c++
[grcpp] Refactoring for testability c++Dimitrios Platis
 
Locks (Concurrency)
Locks (Concurrency)Locks (Concurrency)
Locks (Concurrency)Sri Prasanna
 
NoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyNoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyAlexandre Morgaut
 
Riding the Binlog: an in Deep Dissection of the Replication Stream
Riding the Binlog: an in Deep Dissection of the Replication StreamRiding the Binlog: an in Deep Dissection of the Replication Stream
Riding the Binlog: an in Deep Dissection of the Replication StreamJean-François Gagné
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseSages
 
Much Ado About Blocking: Wait/Wakke in the Linux Kernel
Much Ado About Blocking: Wait/Wakke in the Linux KernelMuch Ado About Blocking: Wait/Wakke in the Linux Kernel
Much Ado About Blocking: Wait/Wakke in the Linux KernelDavidlohr Bueso
 
Varnish in action phpday2011
Varnish in action phpday2011Varnish in action phpday2011
Varnish in action phpday2011Combell NV
 
Varnish in action phpuk11
Varnish in action phpuk11Varnish in action phpuk11
Varnish in action phpuk11Combell NV
 
In-depth caching in Varnish - GOG Varnish Meetup, march 2019
In-depth caching in Varnish - GOG Varnish Meetup, march 2019In-depth caching in Varnish - GOG Varnish Meetup, march 2019
In-depth caching in Varnish - GOG Varnish Meetup, march 2019GOG.com dev team
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsJean-François Gagné
 
Mysql handle socket
Mysql handle socketMysql handle socket
Mysql handle socketPhilip Zhong
 
swift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClientswift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClientShinya Mochida
 

What's hot (20)

FwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.jsFwDays 2021: Metarhia Technology Stack for Node.js
FwDays 2021: Metarhia Technology Stack for Node.js
 
Building Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDBBuilding Your First Data Science Applicatino in MongoDB
Building Your First Data Science Applicatino in MongoDB
 
Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++Работа с реляционными базами данных в C++
Работа с реляционными базами данных в C++
 
Django cryptography
Django cryptographyDjango cryptography
Django cryptography
 
[grcpp] Refactoring for testability c++
[grcpp] Refactoring for testability c++[grcpp] Refactoring for testability c++
[grcpp] Refactoring for testability c++
 
Nancy + rest mow2012
Nancy + rest   mow2012Nancy + rest   mow2012
Nancy + rest mow2012
 
Locks (Concurrency)
Locks (Concurrency)Locks (Concurrency)
Locks (Concurrency)
 
NoSQL and JavaScript: a love story
NoSQL and JavaScript: a love storyNoSQL and JavaScript: a love story
NoSQL and JavaScript: a love story
 
04 - Qt Data
04 - Qt Data04 - Qt Data
04 - Qt Data
 
Riding the Binlog: an in Deep Dissection of the Replication Stream
Riding the Binlog: an in Deep Dissection of the Replication StreamRiding the Binlog: an in Deep Dissection of the Replication Stream
Riding the Binlog: an in Deep Dissection of the Replication Stream
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
 
Much Ado About Blocking: Wait/Wakke in the Linux Kernel
Much Ado About Blocking: Wait/Wakke in the Linux KernelMuch Ado About Blocking: Wait/Wakke in the Linux Kernel
Much Ado About Blocking: Wait/Wakke in the Linux Kernel
 
分散式系統
分散式系統分散式系統
分散式系統
 
Varnish in action phpday2011
Varnish in action phpday2011Varnish in action phpday2011
Varnish in action phpday2011
 
Varnish in action phpuk11
Varnish in action phpuk11Varnish in action phpuk11
Varnish in action phpuk11
 
In-depth caching in Varnish - GOG Varnish Meetup, march 2019
In-depth caching in Varnish - GOG Varnish Meetup, march 2019In-depth caching in Varnish - GOG Varnish Meetup, march 2019
In-depth caching in Varnish - GOG Varnish Meetup, march 2019
 
Disruptor
DisruptorDisruptor
Disruptor
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 
Mysql handle socket
Mysql handle socketMysql handle socket
Mysql handle socket
 
swift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClientswift-nio のアーキテクチャーと RxHttpClient
swift-nio のアーキテクチャーと RxHttpClient
 

Viewers also liked

Investor Due Diligence: Getting Your Ducks in a Row
Investor Due Diligence: Getting Your Ducks in a RowInvestor Due Diligence: Getting Your Ducks in a Row
Investor Due Diligence: Getting Your Ducks in a RowDavid Ehrenberg
 
F R E E C O N C E R T S
F R E E  C O N C E R T SF R E E  C O N C E R T S
F R E E C O N C E R T STickets.co.uk
 
Ludic Interfaces
Ludic InterfacesLudic Interfaces
Ludic Interfacesvincevader
 
118871442 ra-3720-foods-drugs-devices-and-cosmetic-act
118871442 ra-3720-foods-drugs-devices-and-cosmetic-act118871442 ra-3720-foods-drugs-devices-and-cosmetic-act
118871442 ra-3720-foods-drugs-devices-and-cosmetic-actWingielyn Baldoza
 
Intro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsIntro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsMicrosoft Mobile Developer
 

Viewers also liked (8)

Investor Due Diligence: Getting Your Ducks in a Row
Investor Due Diligence: Getting Your Ducks in a RowInvestor Due Diligence: Getting Your Ducks in a Row
Investor Due Diligence: Getting Your Ducks in a Row
 
F R E E C O N C E R T S
F R E E  C O N C E R T SF R E E  C O N C E R T S
F R E E C O N C E R T S
 
Ludic Interfaces
Ludic InterfacesLudic Interfaces
Ludic Interfaces
 
118871442 ra-3720-foods-drugs-devices-and-cosmetic-act
118871442 ra-3720-foods-drugs-devices-and-cosmetic-act118871442 ra-3720-foods-drugs-devices-and-cosmetic-act
118871442 ra-3720-foods-drugs-devices-and-cosmetic-act
 
Healthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia AshaHealthcare apps for Nokia X and Nokia Asha
Healthcare apps for Nokia X and Nokia Asha
 
Lumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK betaLumia App Labs: Lumia SensorCore SDK beta
Lumia App Labs: Lumia SensorCore SDK beta
 
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - ImagingNokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
 
Intro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and toolsIntro to Nokia X software platform 2.0 and tools
Intro to Nokia X software platform 2.0 and tools
 

Similar to Qt Network Explained (Portuguese)

Василий Сорокин, Простой REST сервер на Qt с рефлексией
Василий Сорокин, Простой REST сервер на Qt с рефлексиейВасилий Сорокин, Простой REST сервер на Qt с рефлексией
Василий Сорокин, Простой REST сервер на Qt с рефлексиейSergey Platonov
 
Qt & Webkit
Qt & WebkitQt & Webkit
Qt & WebkitQT-day
 
(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++Amazon Web Services
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)DongHyeon Kim
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the wayOleg Podsechin
 
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com GoTDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com Gotdc-globalcode
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Svet Ivantchev
 
[JEEConf-2017] RxJava as a key component in mature Big Data product
[JEEConf-2017] RxJava as a key component in mature Big Data product[JEEConf-2017] RxJava as a key component in mature Big Data product
[JEEConf-2017] RxJava as a key component in mature Big Data productIgor Lozynskyi
 
Udp socket programming(Florian)
Udp socket programming(Florian)Udp socket programming(Florian)
Udp socket programming(Florian)Flor Ian
 
Compose Async with RxJS
Compose Async with RxJSCompose Async with RxJS
Compose Async with RxJSKyung Yeol Kim
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryAlexandre Morgaut
 
Networking.ppt(client/server, socket) uses in program
Networking.ppt(client/server, socket) uses in programNetworking.ppt(client/server, socket) uses in program
Networking.ppt(client/server, socket) uses in programgovindjha339843
 
Correcting Common .NET Mistakes in Async Await .pptx
Correcting Common .NET Mistakes in Async Await .pptxCorrecting Common .NET Mistakes in Async Await .pptx
Correcting Common .NET Mistakes in Async Await .pptxBrandon Minnick, MBA
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeKAI CHU CHUNG
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftFlorent Pillet
 

Similar to Qt Network Explained (Portuguese) (20)

Василий Сорокин, Простой REST сервер на Qt с рефлексией
Василий Сорокин, Простой REST сервер на Qt с рефлексиейВасилий Сорокин, Простой REST сервер на Qt с рефлексией
Василий Сорокин, Простой REST сервер на Qt с рефлексией
 
Winform
WinformWinform
Winform
 
Qt & Webkit
Qt & WebkitQt & Webkit
Qt & Webkit
 
(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the way
 
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com GoTDC2018SP | Trilha Go - Processando analise genetica em background com Go
TDC2018SP | Trilha Go - Processando analise genetica em background com Go
 
Npc08
Npc08Npc08
Npc08
 
Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016Gaztea Tech Robotica 2016
Gaztea Tech Robotica 2016
 
[JEEConf-2017] RxJava as a key component in mature Big Data product
[JEEConf-2017] RxJava as a key component in mature Big Data product[JEEConf-2017] RxJava as a key component in mature Big Data product
[JEEConf-2017] RxJava as a key component in mature Big Data product
 
Udp socket programming(Florian)
Udp socket programming(Florian)Udp socket programming(Florian)
Udp socket programming(Florian)
 
Marat-Slides
Marat-SlidesMarat-Slides
Marat-Slides
 
3
33
3
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
 
Compose Async with RxJS
Compose Async with RxJSCompose Async with RxJS
Compose Async with RxJS
 
NoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love StoryNoSQL and JavaScript: a Love Story
NoSQL and JavaScript: a Love Story
 
Networking.ppt(client/server, socket) uses in program
Networking.ppt(client/server, socket) uses in programNetworking.ppt(client/server, socket) uses in program
Networking.ppt(client/server, socket) uses in program
 
Correcting Common .NET Mistakes in Async Await .pptx
Correcting Common .NET Mistakes in Async Await .pptxCorrecting Common .NET Mistakes in Async Await .pptx
Correcting Common .NET Mistakes in Async Await .pptx
 
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with easeGDG Devfest 2019 - Build go kit microservices at kubernetes with ease
GDG Devfest 2019 - Build go kit microservices at kubernetes with ease
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwift
 

More from Microsoft Mobile Developer

Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagMicrosoft Mobile Developer
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsMicrosoft Mobile Developer
 
Windows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appWindows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appMicrosoft Mobile Developer
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeMicrosoft Mobile Developer
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoMicrosoft Mobile Developer
 
Lens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraLens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraMicrosoft Mobile Developer
 
Nokia Asha webinar: Developing health-care applications for Nokia Asha phones
Nokia Asha webinar: Developing health-care applications for Nokia Asha phonesNokia Asha webinar: Developing health-care applications for Nokia Asha phones
Nokia Asha webinar: Developing health-care applications for Nokia Asha phonesMicrosoft Mobile Developer
 

More from Microsoft Mobile Developer (20)

Push notifications on Nokia X
Push notifications on Nokia XPush notifications on Nokia X
Push notifications on Nokia X
 
DIY Nokia Asha app usability studies
DIY Nokia Asha app usability studiesDIY Nokia Asha app usability studies
DIY Nokia Asha app usability studies
 
Lessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviewsLessons learned from Nokia X UI reviews
Lessons learned from Nokia X UI reviews
 
Location based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tagLocation based services for Nokia X and Nokia Asha using Geo2tag
Location based services for Nokia X and Nokia Asha using Geo2tag
 
HERE Maps for the Nokia X platform
HERE Maps for the Nokia X platformHERE Maps for the Nokia X platform
HERE Maps for the Nokia X platform
 
Nokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerationsNokia In-App Payment - UX considerations
Nokia In-App Payment - UX considerations
 
Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)Introduction to Nokia Asha SDK 1.2 (beta)
Introduction to Nokia Asha SDK 1.2 (beta)
 
UX considerations when porting to Nokia X
UX considerations when porting to Nokia XUX considerations when porting to Nokia X
UX considerations when porting to Nokia X
 
Kids' games and educational app design
Kids' games and educational app designKids' games and educational app design
Kids' games and educational app design
 
Nokia X: opportunities for developers
Nokia X: opportunities for developersNokia X: opportunities for developers
Nokia X: opportunities for developers
 
Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1Lumia App Labs: Nokia Imaging SDK 1.1
Lumia App Labs: Nokia Imaging SDK 1.1
 
Intro to Nokia X software platform and tools
Intro to Nokia X software platform and toolsIntro to Nokia X software platform and tools
Intro to Nokia X software platform and tools
 
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultationsLumia App Labs: Lessons learned from 50 windows phone 8 design consultations
Lumia App Labs: Lessons learned from 50 windows phone 8 design consultations
 
Windows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra appWindows Phone 8 speech: parliamo con la nostra app
Windows Phone 8 speech: parliamo con la nostra app
 
La pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo storeLa pubblicazione di un'applicazione sullo store
La pubblicazione di un'applicazione sullo store
 
Il pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progettoIl pattern mvvm come strutturare al meglio il vostro progetto
Il pattern mvvm come strutturare al meglio il vostro progetto
 
Lens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocameraLens app trasformare il telefono in una fotocamera
Lens app trasformare il telefono in una fotocamera
 
NFC, Bluetooth e comunicazione tra app
NFC, Bluetooth e comunicazione tra appNFC, Bluetooth e comunicazione tra app
NFC, Bluetooth e comunicazione tra app
 
Nokia Asha webinar: Developing health-care applications for Nokia Asha phones
Nokia Asha webinar: Developing health-care applications for Nokia Asha phonesNokia Asha webinar: Developing health-care applications for Nokia Asha phones
Nokia Asha webinar: Developing health-care applications for Nokia Asha phones
 
Connettersi al Cloud Azure Mobile Services
Connettersi al Cloud Azure Mobile ServicesConnettersi al Cloud Azure Mobile Services
Connettersi al Cloud Azure Mobile Services
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 

Qt Network Explained (Portuguese)

  • 1. ECOSYSTEM 1 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 2. QtNetwork explained 2 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 3. TÓPICOS • Introdução ao QtNetwork • Por que usar QtNetwork • Sockets ● QAbstractSocket ● QTcpSocket – QsslSocket ● QTcpServer ● QudpSocket – Broadcast – Multicast (somente 4.8 !symbian) 3 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 4. TÓPICOS • High level networking ● QnetworkAccessManager ● QnetworkConfiguration ● QnetworkConfigurationManager ● QnetworkSession ● QnetworkRequest ● QNetworkReply 4 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 5. Introdução ao QtNetwork • QtNetwork é um módulo do Qt • Provê uma interface cross platforma para escrever aplicações cliente servidor TCP/IP • Suporta proxy • Possui classes para realizar requests http e ftp, acessar web services e tratar suas respostas. • Pegar informações sobre dispositivos de rede • É possível ainda gerenciar o estado de conexão com a rede, ter configurações específicas para cada uma e realizar ações.
  • 6. Por que usar QtNetwork? int main() { int main() int fd = socket(AF_INET, SOCK_STREAM, 0); { if (fd == 1) { QCoreApplication app(argc, argv); printf("can not create socket"); exit(1); } QTcpServer server; struct sockaddr_in saddr; bzero(&saddr, sizeof(saddr)); server.listen(QHostAddress::Any, 1100); saddr.sin_family = AF_INET; saddr.sin_port = htons(1100); saddr.sin_addr.s_addr = htonl(INADDR_ANY); while (server.waitForNewConnection()) { do { if (bind(fd,(struct sockaddr *)&saddr, sizeof(saddr)) == 1) { QTcpSocket *socket = server.nextPendingConnection(); printf("error bind failed"); socket->write(“Hello, world!”); exit(1); } socket->disconnectFromHost(); if (listen(fd, 10) == 1) socket->waitForDisconnected(); { delete socket; printf("error listen failed"); exit(1); } while (server.hasPendingConnections()); } } for(;;) { int connfd = accept(fd, NULL, NULL); } if(connfd <= 0) { printf("error accept failed"); exit(1); } write(connfd, "Hello world!n", 13); close(connfd); } return 0; }
  • 7. Sockets: QAbstractSocket • QabstractSocket é uma camada de abstração multi plataforma para api nativa de network • Implementa TCP, UDP e sockets locais • Herda de QIODevice 7 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 8. Sockets: QTcpSocket ● Subclasse de conveniência do QAbstractSocket ● Pode ser utilizado pra implementar vários tipos protocolos ● Stream de dados contínuo ● Poder ser usado de maneira asíncrona ou síncrona.
  • 9. Sockets: QTcpSocket ClientSocket::ClientSocket(QObject *parent) ServerSocket::ServerSocket(QObject *parent) : QTcpSocket(parent) : QTcpSocket(parent) { { connect(this, SIGNAL(readyRead()), connect(this, SIGNAL(readyRead()), this, SLOT(onReadyRead())); this, SLOT(onReadyRead())); } connect(this, SIGNAL(disconnected()), void ServerSocket::onServerInfoResponse(const QVariantMap &map) this, SLOT(onDisconnected())); { QJson::Serializer serializer; connect(this, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(onError(QAbstractSocket::SocketError))); write(serializer.serialize(map)); } flush(); } void ClientSocket::onDisconnected() { void ServerSocket::onServerStatusChanged(const QString &status) qDebug() << "[ClientSocket] Client disconnected!"; } { QVariantMap map; void ClientSocket::onError(QAbstractSocket::SocketError error) map["what"] = "server"; { map["action"] = "statusChanged"; map["status"] = status; qDebug() << "[ClientSocket] Error: " << error; } QJson::Serializer serializer; write(serializer.serialize(map)); void ClientSocket::requestServerInfo() flush(); { } QVariantMap map; QJson::Serializer serializer; void ServerSocket::onReadyRead() { while (canReadLine()) { map["what"] = "server"; QByteArray line = readLine(); map["action"] = "serverInfo"; write(serializer.serialize(map)"); bool parserOk = true; } QJson::Parser parser; void ClientSocket::onQJsonParsingFinished(const QVariant &json, bool ok, const QString &error_msg) QVariant var = parser.parse(line, &parserOk); { if (!parserOk) { if (!ok) { qWarning() qWarning() << Q_FUNC_INFO << "json error at" << error_msg; << Q_FUNC_INFO return; << "json error at" } << parser.errorLine() << parser.errorString(); QVariantMap map = json.toMap(); } else { QString what = map["what"].toString(); QVariantMap map = var.toMap(); if (what == "server") { QString what = map["what"].toString(); if (what == "server") { QString action = map["action"].toString(); QString action = map["action"].toString(); if (action == "serverInfo") { if (action == "info") { emit serverInfoReceived(map); emit serverInfoRequested(); } } } } } } } }
  • 10. Sockets: QTcpServer ● Precisa receber conexões? Essa é a classe certa. ● Pode ser single threaded or multi threaded ● Single threaded ● Um ou vários sockets usando mesmo Event loop ● Ou Bloqueante ● Multi threaded ● Um socket por thread – Bloqueante – Ou um Event loop por thread
  • 11. Sockets: QTcpServer Server::Server(QObject *parent) : QtcpServer(parent) , m_serverInfo() { } void Server::start() { listen(QHostAddress::Any, 12345); } void Server::incomingConnection(int socketDescriptor) { ServerSocket *sock = new ServerSocket; sock->setSocketDescriptor(socketDescriptor); QThread *thread = new QThread; sock->moveToThread(thread); connect(sock, SIGNAL(disconnected()), sock, SLOT(deleteLater())); connect(sock, SIGNAL(destroyed()), thread, SLOT(quit())); connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater())); connect(this, SIGNAL(statusChanged(const Qstring &)), sock, SLOT(onServerStatusChanged(const Qstring &))); connect(sock, SIGNAL(serverInfoRequested()), this, SLOT(onServerInfoRequested())); thread->start(); } void Server::onServerInfoRequested() { ServerSocket *sock = qobject_cast<ServerSocket*>(sender()); if (!sock) return; QMetaObject::invokeMethod(sock, "onServerInfoResponse", Q_ARG(QVariantMap, m_serverInfo)); }
  • 12. Sockets: QudpSocket Broadcast BroadcastAnnounce::BroadcastAnnounce(QObject *parent) : QObject(parent) , m_socket(new QUdpSocket(this)) , m_timer(new QTimer(this)) , m_serverInfo() { connect(m_timer, SIGNAL(timeout()), this, SLOT(sendDatagram())); } void BroadcastAnnounce::start() { if (m_timer->isActive()) m_timer->stop(); m_timer->start(1000); } void BroadcastAnnounce::stop() { m_timer->stop(); } void BroadcastAnnounce::setServerInfo(const QVariantMap &map) { m_serverInfo = map; } void BroadcastAnnounce::sendDatagram() { QByteArray datagram; QDataStream out(&datagram, QIODevice::WriteOnly); out.setVersion(QDataStream::Qt_4_7); out << QVariant(m_serverInfo); m_socket->writeDatagram(datagram.data(), datagram.size(), QHostAddress::Broadcast, UDP_PORT); }
  • 13. Sockets: QudpSocket Broadcast BroadcastAnnounce::BroadcastAnnounce(QObject *parent) BroadcastDiscover::BroadcastDiscover(QObject *parent) : QObject(parent) : QObject(parent) , m_socket() , m_timer(new QTimer(this)) , m_socket(new QUdpSocket(this)) { , m_timer(new QTimer(this)) connect(m_timer, SIGNAL(timeout()), this, SLOT(stop())); } , m_serverInfo() { void BroadcastDiscover::start() { connect(m_timer, SIGNAL(timeout()), this, SLOT(sendDatagram())); m_socket = new QUdpSocket(this); } m_socket->bind(UDP_PORT, QUdpSocket::ShareAddress); connect(m_socket, SIGNAL(readyRead()), this, SLOT(processDatagrams())); void BroadcastAnnounce::start() m_timer->start(10000); } { if (m_timer->isActive()) void BroadcastDiscover::stop() { m_timer->stop(); disconnect(m_socket, SIGNAL(readyRead()), this, SLOT(processDatagrams())); m_socket->close(); m_timer->start(1000); emit timeout(); } } void BroadcastDiscover::processDatagrams() void BroadcastAnnounce::stop() { QUdpSocket *socket = qobject_cast<QUdpSocket *>(sender()); { if (!socket) m_timer->stop(); return; } while (socket->hasPendingDatagrams()) { QByteArray datagram; void BroadcastAnnounce::setServerInfo(const QVariantMap &map) QHostAddress host; { datagram.resize(socket->pendingDatagramSize()); m_serverInfo = map; socket->readDatagram(datagram.data(), datagram.size(), &host); } QVariant message; void BroadcastAnnounce::sendDatagram() QDataStream dataStream(&datagram, QIODevice::ReadOnly); { dataStream >> message; QByteArray datagram; const QVariantMap map = message.toMap(); QDataStream out(&datagram, QIODevice::WriteOnly); if (map["app_id"].toString() == APP_ID) { const QString action = map["action"].toString(); out.setVersion(QDataStream::Qt_4_7); if (action == "serverAnnounce") { out << QVariant(m_serverInfo); emit serverFound(map); } m_socket->writeDatagram(datagram.data(), datagram.size(), QHostAddress::Broadcast, } UDP_PORT); } } }
  • 14. Sockets: QudpSocket Multicast MulticastAnnounce::MulticastAnnounce(QObject *parent) MulticastDiscover::MulticastDiscover(QObject *parent) : QObject(parent) : QObject(parent) , m_socket() , m_socket(new QUdpSocket(this)) , m_timer(new QTimer(this)) { , m_timer(new QTimer(this)) connect(m_timer, SIGNAL(timeout()), this, SLOT(stop())); , m_serverInfo() } { void MulticastDiscover::start() connect(m_timer, SIGNAL(timeout()), this, SLOT(sendDatagram())); { m_socket = new QUdpSocket(this); m_socket->setSocketOption(QAbstractSocket::MulticastTtlOption, 1); m_socket->bind(UDP_PORT, QUdpSocket::ShareAddress); m_socket->joinMulticastGroup(QHostAddress("239.255.43.21")); } connect(m_socket, SIGNAL(readyRead()), this, SLOT(processDatagrams())); void MulticastAnnounce::start() m_timer->start(10000); { } if (m_timer->isActive()) void MulticastDiscover::stop() m_timer->stop(); { disconnect(m_socket, SIGNAL(readyRead()), this, SLOT(processDatagrams())); m_timer->start(1000); m_socket->close(); } emit timeout(); } void MulticastAnnounce::stop() void MulticastDiscover::processDatagrams() { { m_timer->stop(); QUdpSocket *socket = qobject_cast<QUdpSocket *>(sender()); if (!socket) } return; while (socket->hasPendingDatagrams()) { void MulticastAnnounce::setServerInfo(const QVariantMap &map) QByteArray datagram; { QHostAddress host; m_serverInfo = map; datagram.resize(socket->pendingDatagramSize()); } socket->readDatagram(datagram.data(), datagram.size(), &host); void MulticastAnnounce::sendDatagram() QVariant message; QDataStream dataStream(&datagram, QIODevice::ReadOnly); dataStream >> message; { QByteArray datagram; const QVariantMap map = message.toMap(); if (map["app_id"].toString() == APP_ID) { QDataStream out(&datagram, QIODevice::WriteOnly); const QString action = map["action"].toString(); out.setVersion(QDataStream::Qt_4_8); if (action == "serverAnnounce") { out << QVariant(m_serverInfo); emit serverFound(map); } } m_socket->writeDatagram(datagram.data(), datagram.size(), QHostAddress("239.255.43.21"), UDP_PORT); } } }
  • 15. Sockets: QUdpSocket ● Subclasse de conveniência do QabstractSocket para UDP ● Envio de pacotes de dados ao invés de stream contínuo ● Possui suporte a Broadcast ● Desde o Qt 4.8 suporte a Multicast
  • 16. QnetworkConfigurationManager 1- Definir o Ponto de Acesso QNetworkConfigurationManager manager; //Define que o usuário pode escolher um ponto de acesso const bool canStartIAP = (manager.capabilities()& QnetworkConfigurationManager::CanStartAndStopInterfaces); //Retorna a configuração padrão atual manager.defaultConfiguration(); 16 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 17. QnetworkConfiguration 1- Definir o Ponto de Acesso QNetworkConfigurationManager manager; //Define que o usuário pode escolher um ponto de acesso const bool canStartIAP = (manager.capabilities()& QNetworkConfigurationManager::CanStartAndStopInterfaces); //Se existe um ponto de acesso padrao. Basta utiliza-lo usando a configuracao padrao do QNetWorkConfigurarionManager QNetworkConfiguration cfg = manager.defaultConfiguration(); if (!cfg.isValid() || !canStartIAP) { // Pontos de acesso nao encontrados ou impossivel se conectar // Alertar usuario e fazer tratamento de erro return; } 17 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 18. QnetworkSession // Caso a conexao tenha ocorrido com sucesso, abrir um QNetworkSession usando a configuracao padrao m_session = new QNetworkSession(cfg); //Conectar sinais necessarios connect(m_session, SIGNAL(closed()), this, SLOT(closed())); connect(m_session, SIGNAL(stateChanged(QNetworkSession::State)), this, SLOT(stateChanged(QNetworkSession::State))); connect(m_session, SIGNAL(error(QNetworkSession::SessionError)), this, SLOT(error(QNetworkSession::SessionError))); Abrir aconexao m_session->open(); // Espera a sessão ser aberta e continua a partir dai m_session->waitForOpened(); Para fechar a sessão, usar o slot finished() 18 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 19. QnetworkAccessManager 1- Criar um Network Access Manager nam = new QNetworkAccessManager(this); 2- Conectar o sinal finished a um slot para tratar o resultado QObject::connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finishedSlot(QNetworkReply*))); 19 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 20. QnetworkRequest 1- Criar um Network Access Manager nam = new QNetworkAccessManager(this); 2- Conectar o sinal finished a um slot para tratar o resultado QObject::connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finishedSlot(QNetworkReply*))); 3- Criar o Request QUrl url(http://query.yahooapis.com/v1/public/yql); url.addQueryItem(QUERY_PARAM, QLatin1String("select+*+from+geo.placefinder+where+text="") + "Sao Paulo" + QLatin1String(""")); url.addQueryItem("format", "json"); QnetworkRequest request(url); 20 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 21. QNetworkReply 1- Criar um Network Access Manager nam = new QNetworkAccessManager(this); 2- Conectar o sinal finished a um slot para tratar o resultado QObject::connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finishedSlot(QNetworkReply*))); 3- Criar o Request QUrl url(http://query.yahooapis.com/v1/public/yql); url.addQueryItem(QUERY_PARAM, QLatin1String("select+*+from+geo.placefinder+where+text="") + "Sao Paulo" + QLatin1String(""")); url.addQueryItem("format", "json"); QnetworkRequest request(url); 4- Guardar o reply do request par ser usado como identificador da resposta QNetworkReply* reply = nam->get(request) 21 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 22. QNetworkReply 4- Tratar o Reply void MyHttpEngine::finishedSlot(QNetworkReply* reply) { // Ler Atributos do Repply como ocodigo de Status HTTP QVariant statusCodeV = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); void MyHttpEngine::finishedSlot(QNetworkReply* reply) { // Ler Atributos do Repply como o codigo de Status HTTP QVariant statusCodeV = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute); // Ou a URL, se esta tiver sido redirecionada: QVariant redirectionTargetUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); // Verificar se houve erro if (reply->error() == QnetworkReply::NoError) { // Se nao houve erro, ler os dados da resposta //Ex1: Criando um QImage da resposta QImageReader imageReader(reply); QImage pic = imageReader.read(); } } 22 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]
  • 23. Canais de comunicação • @nokiadev_brasil • rodrigo.belem@openbossa.org 23 INdT 2012 | Filename.pptx v. 0.1 YYYY-MM-DD Author Document ID [Edit via Insert > Header & Footer]