[DEV] remove dependency of unistd.h
This commit is contained in:
parent
c6a592592a
commit
090c280e34
@ -11,7 +11,7 @@
|
|||||||
#include <etk/etk.hpp>
|
#include <etk/etk.hpp>
|
||||||
#include <zeus/zeus.hpp>
|
#include <zeus/zeus.hpp>
|
||||||
#include <etk/os/FSNode.hpp>
|
#include <etk/os/FSNode.hpp>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include <etk/stdTools.hpp>
|
#include <etk/stdTools.hpp>
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
}
|
}
|
||||||
int32_t iii=0;
|
int32_t iii=0;
|
||||||
while (iii < 3) {
|
while (iii < 3) {
|
||||||
usleep(500000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
APPL_INFO("Appl in waiting ... " << iii << "/3");
|
APPL_INFO("Appl in waiting ... " << iii << "/3");
|
||||||
iii++;
|
iii++;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <zeus/Service.hpp>
|
#include <zeus/Service.hpp>
|
||||||
#include <etk/etk.hpp>
|
#include <etk/etk.hpp>
|
||||||
#include <zeus/zeus.hpp>
|
#include <zeus/zeus.hpp>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include <etk/stdTools.hpp>
|
#include <etk/stdTools.hpp>
|
||||||
namespace appl {
|
namespace appl {
|
||||||
@ -105,7 +105,7 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
serviceInterface.connect();
|
serviceInterface.connect();
|
||||||
int32_t iii=0;
|
int32_t iii=0;
|
||||||
while (true) {
|
while (true) {
|
||||||
usleep(1000000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||||
serviceInterface.pingIsAlive();
|
serviceInterface.pingIsAlive();
|
||||||
APPL_INFO("service in waiting ... " << iii << "/inf");
|
APPL_INFO("service in waiting ... " << iii << "/inf");
|
||||||
iii++;
|
iii++;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include <zeus/File.hpp>
|
#include <zeus/File.hpp>
|
||||||
#include <etk/etk.hpp>
|
#include <etk/etk.hpp>
|
||||||
#include <zeus/zeus.hpp>
|
#include <zeus/zeus.hpp>
|
||||||
#include <unistd.h>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <ejson/ejson.hpp>
|
#include <ejson/ejson.hpp>
|
||||||
#include <etk/os/FSNode.hpp>
|
#include <etk/os/FSNode.hpp>
|
||||||
@ -430,12 +430,12 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
APPL_INFO("== ZEUS service: " << *serviceInterface.propertyNameService << " [STOP] Can not connect to the GateWay");
|
APPL_INFO("== ZEUS service: " << *serviceInterface.propertyNameService << " [STOP] Can not connect to the GateWay");
|
||||||
APPL_INFO("===========================================================");
|
APPL_INFO("===========================================================");
|
||||||
APPL_INFO("wait 5 second ...");
|
APPL_INFO("wait 5 second ...");
|
||||||
usleep(5000000);
|
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int32_t iii=0;
|
int32_t iii=0;
|
||||||
while (serviceInterface.GateWayAlive() == true) {
|
while (serviceInterface.GateWayAlive() == true) {
|
||||||
usleep(1000000);
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
serviceInterface.pingIsAlive();
|
serviceInterface.pingIsAlive();
|
||||||
/*
|
/*
|
||||||
serviceInterface.store();
|
serviceInterface.store();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <appl/ClientInterface.hpp>
|
#include <appl/ClientInterface.hpp>
|
||||||
#include <zeus/Future.hpp>
|
#include <zeus/Future.hpp>
|
||||||
#include <appl/GateWay.hpp>
|
#include <appl/GateWay.hpp>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include <zeus/AbstractFunction.hpp>
|
#include <zeus/AbstractFunction.hpp>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <appl/GateWay.hpp>
|
#include <appl/GateWay.hpp>
|
||||||
#include <etk/etk.hpp>
|
#include <etk/etk.hpp>
|
||||||
#include <zeus/zeus.hpp>
|
#include <zeus/zeus.hpp>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include <etk/stdTools.hpp>
|
#include <etk/stdTools.hpp>
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
APPL_INFO("==================================");
|
APPL_INFO("==================================");
|
||||||
basicGateway.start();
|
basicGateway.start();
|
||||||
while (true) {
|
while (true) {
|
||||||
usleep(100000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||||
basicGateway.cleanIO();
|
basicGateway.cleanIO();
|
||||||
}
|
}
|
||||||
basicGateway.stop();
|
basicGateway.stop();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <zeus/Service.hpp>
|
#include <zeus/Service.hpp>
|
||||||
#include <etk/etk.hpp>
|
#include <etk/etk.hpp>
|
||||||
#include <zeus/zeus.hpp>
|
#include <zeus/zeus.hpp>
|
||||||
#include <unistd.h>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <ejson/ejson.hpp>
|
#include <ejson/ejson.hpp>
|
||||||
|
|
||||||
@ -244,12 +244,12 @@ int main(int _argc, const char *_argv[]) {
|
|||||||
APPL_INFO("== ZEUS service: " << *serviceInterface.propertyNameService << " [STOP] Can not connect to the GateWay");
|
APPL_INFO("== ZEUS service: " << *serviceInterface.propertyNameService << " [STOP] Can not connect to the GateWay");
|
||||||
APPL_INFO("===========================================================");
|
APPL_INFO("===========================================================");
|
||||||
APPL_INFO("wait 5 second ...");
|
APPL_INFO("wait 5 second ...");
|
||||||
usleep(5000000);
|
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int32_t iii=0;
|
int32_t iii=0;
|
||||||
while (serviceInterface.GateWayAlive() == true) {
|
while (serviceInterface.GateWayAlive() == true) {
|
||||||
usleep(1000000);
|
std::this_thread::sleep_for(std::chrono::seconds(10));
|
||||||
serviceInterface.pingIsAlive();
|
serviceInterface.pingIsAlive();
|
||||||
APPL_INFO("service in waiting ... " << iii << "/inf");
|
APPL_INFO("service in waiting ... " << iii << "/inf");
|
||||||
iii++;
|
iii++;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include <zeus/Client.hpp>
|
#include <zeus/Client.hpp>
|
||||||
#include <zeus/debug.hpp>
|
#include <zeus/debug.hpp>
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
zeus::Client::Client() :
|
zeus::Client::Client() :
|
||||||
propertyIp(this, "ip", "127.0.0.1", "Ip to connect server", &zeus::Client::onPropertyChangeIp),
|
propertyIp(this, "ip", "127.0.0.1", "Ip to connect server", &zeus::Client::onPropertyChangeIp),
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include <eproperty/Value.hpp>
|
#include <eproperty/Value.hpp>
|
||||||
#include <zeus/debug.hpp>
|
#include <zeus/debug.hpp>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <unistd.h>
|
|
||||||
#include <zeus/Future.hpp>
|
#include <zeus/Future.hpp>
|
||||||
#include <zeus/ServiceRemote.hpp>
|
#include <zeus/ServiceRemote.hpp>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <zeus/Future.hpp>
|
#include <zeus/Future.hpp>
|
||||||
#include <zeus/BufferAnswer.hpp>
|
#include <zeus/BufferAnswer.hpp>
|
||||||
#include <zeus/debug.hpp>
|
#include <zeus/debug.hpp>
|
||||||
#include <unistd.h>
|
|
||||||
#include <zeus/File.hpp>
|
#include <zeus/File.hpp>
|
||||||
|
|
||||||
namespace zeus {
|
namespace zeus {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <zeus/FutureBase.hpp>
|
#include <zeus/FutureBase.hpp>
|
||||||
#include <zeus/BufferAnswer.hpp>
|
#include <zeus/BufferAnswer.hpp>
|
||||||
#include <zeus/debug.hpp>
|
#include <zeus/debug.hpp>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
zeus::FutureBase::FutureBase(const zeus::FutureBase& _base):
|
zeus::FutureBase::FutureBase(const zeus::FutureBase& _base):
|
||||||
m_data(_base.m_data) {
|
m_data(_base.m_data) {
|
||||||
@ -172,7 +172,7 @@ bool zeus::FutureBase::isFinished() const {
|
|||||||
const zeus::FutureBase& zeus::FutureBase::wait() const {
|
const zeus::FutureBase& zeus::FutureBase::wait() const {
|
||||||
while (isFinished() == false) {
|
while (isFinished() == false) {
|
||||||
// TODO : Do it better ... like messaging/mutex_locked ...
|
// TODO : Do it better ... like messaging/mutex_locked ...
|
||||||
usleep(10000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -182,7 +182,7 @@ const zeus::FutureBase& zeus::FutureBase::waitFor(std::chrono::microseconds _del
|
|||||||
while ( std::chrono::steady_clock::now() - start < _delta
|
while ( std::chrono::steady_clock::now() - start < _delta
|
||||||
&& isFinished() == false) {
|
&& isFinished() == false) {
|
||||||
// TODO : Do it better ... like messaging/mutex_locked ...
|
// TODO : Do it better ... like messaging/mutex_locked ...
|
||||||
usleep(10000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
start = std::chrono::steady_clock::now();
|
start = std::chrono::steady_clock::now();
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
@ -192,7 +192,7 @@ const zeus::FutureBase& zeus::FutureBase::waitUntil(std::chrono::steady_clock::t
|
|||||||
while ( std::chrono::steady_clock::now() < _endTime
|
while ( std::chrono::steady_clock::now() < _endTime
|
||||||
&& isFinished() == false) {
|
&& isFinished() == false) {
|
||||||
// TODO : Do it better ... like messaging/mutex_locked ...
|
// TODO : Do it better ... like messaging/mutex_locked ...
|
||||||
usleep(10000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include <etk/stdTools.hpp>
|
#include <etk/stdTools.hpp>
|
||||||
#include <enet/TcpClient.hpp>
|
#include <enet/TcpClient.hpp>
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
zeus::Service::Service() :
|
zeus::Service::Service() :
|
||||||
propertyIp(this, "ip", "127.0.0.1", "Ip to connect server", &zeus::Service::onPropertyChangeIp),
|
propertyIp(this, "ip", "127.0.0.1", "Ip to connect server", &zeus::Service::onPropertyChangeIp),
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <zeus/WebServer.hpp>
|
#include <zeus/WebServer.hpp>
|
||||||
#include <zeus/debug.hpp>
|
#include <zeus/debug.hpp>
|
||||||
#include <ethread/tools.hpp>
|
#include <ethread/tools.hpp>
|
||||||
#include <unistd.h>
|
|
||||||
#include <zeus/BufferData.hpp>
|
#include <zeus/BufferData.hpp>
|
||||||
|
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ void zeus::WebServer::connect(bool _async){
|
|||||||
while ( _async == false
|
while ( _async == false
|
||||||
&& m_threadAsyncRunning == true
|
&& m_threadAsyncRunning == true
|
||||||
&& m_connection.isAlive() != true) {
|
&& m_connection.isAlive() != true) {
|
||||||
usleep(50000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||||
}
|
}
|
||||||
//ethread::setPriority(*m_receiveThread, -6);
|
//ethread::setPriority(*m_receiveThread, -6);
|
||||||
if (_async == true) {
|
if (_async == true) {
|
||||||
@ -281,7 +281,7 @@ void zeus::WebServer::threadAsyncCallback() {
|
|||||||
m_threadAsyncList2.clear();
|
m_threadAsyncList2.clear();
|
||||||
}
|
}
|
||||||
if (m_threadAsyncList.size() == 0) {
|
if (m_threadAsyncList.size() == 0) {
|
||||||
usleep(10000);
|
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto it = m_threadAsyncList.begin();
|
auto it = m_threadAsyncList.begin();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user