- Mf::ResolverTask task("compy", "4950", SOCK_DGRAM);
- task.run();
-
- int i = task.wait();
- Mf::logWarning << "task ended with code: " << i << std::endl;
-
- std::vector<Mf::SocketAddress>::const_iterator it;
- for (it = task.addresses().begin(); it != task.addresses().end(); ++it)
- {
- Mf::SocketAddress addr = *it;
-
- Mf::logInfo << "address: " << addr.name() << ":" << addr.port()
- << " (" << addr.type() << ")" << std::endl;
- }
-
- Mf::SocketAddress addr("www.apple.com", "80", SOCK_DGRAM);
-
- Mf::logInfo << "address: " << addr.name() << ":" << addr.port()
- << " (" << addr.type() << ")" << std::endl;
-
- Mf::Packet packet(1000000);
- packet << (uint16_t)45;
- Mf::logInfo << "packet size: " << packet.size() << std::endl;
- packet << (int64_t)-1234567890123456789;
- Mf::logInfo << "packet size: " << packet.size() << std::endl;
-
- packet << true << false << false << true << false << true << true;
- Mf::logInfo << "packet size: " << packet.size() << std::endl;
-
- std::vector<char> hi;
- hi.push_back(34);
- hi.push_back(-12345);
- hi.push_back(7734);
-
- for (int a = 0; a < 15900; a++)
- {
- hi.push_back(a);
- }
-
- packet << hi;
- Mf::logInfo << "packet size: " << packet.size() << std::endl;
-
- packet << "hello world";
- Mf::logInfo << "packet size: " << packet.size() << std::endl;
-
- packet << false << false << false << true << false;
- Mf::logInfo << "packet size: " << packet.size() << std::endl;
-
-
- for (it = task.addresses().begin(); it != task.addresses().end(); ++it)
- {
- Mf::SocketAddress addr = *it;
- Mf::Socket sock(addr);
- sock.write(packet);
- }
-
-
- return 0;
-