BIG changes added
git-svn-id: svn://db.shs.com.ru/pip@129 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -71,6 +71,13 @@ void __sighandler__(PISignals::Signal s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef ANDROID
|
||||||
|
void android_thread_exit_handler(int sig) {
|
||||||
|
pthread_exit(0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
PIInit::PIInit() {
|
PIInit::PIInit() {
|
||||||
PISystemInfo * sinfo = PISystemInfo::instance();
|
PISystemInfo * sinfo = PISystemInfo::instance();
|
||||||
sinfo->execDateTime = PIDateTime::current();
|
sinfo->execDateTime = PIDateTime::current();
|
||||||
@@ -129,6 +136,13 @@ PIInit::PIInit() {
|
|||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
setlocale(LC_NUMERIC, "C");
|
setlocale(LC_NUMERIC, "C");
|
||||||
# endif
|
# endif
|
||||||
|
#else
|
||||||
|
struct sigaction actions;
|
||||||
|
memset(&actions, 0, sizeof(actions));
|
||||||
|
sigemptyset(&actions.sa_mask);
|
||||||
|
actions.sa_flags = 0;
|
||||||
|
actions.sa_handler = android_thread_exit_handler;
|
||||||
|
sigaction(SIGTERM, &actions, 0);
|
||||||
#endif
|
#endif
|
||||||
#ifdef PIP_ICU
|
#ifdef PIP_ICU
|
||||||
__syslocname__ = __sysoemname__ = 0;
|
__syslocname__ = __sysoemname__ = 0;
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ PIEthernet::PIEthernet(int sock_, PIString ip_port): PIIODevice("", ReadWrite) {
|
|||||||
parseAddress(ip_port, &ip_s, &port_s);
|
parseAddress(ip_port, &ip_s, &port_s);
|
||||||
sock = sock_;
|
sock = sock_;
|
||||||
init_ = opened_ = connected_ = true;
|
init_ = opened_ = connected_ = true;
|
||||||
setParameters(PIEthernet::ReuseAddress | PIEthernet::MulticastLoop | PIEthernet::KeepConnection);
|
setParameters(PIEthernet::ReuseAddress | PIEthernet::MulticastLoop);
|
||||||
setType(TCP_Client, false);
|
setType(TCP_Client, false);
|
||||||
setPath(ip_port);
|
setPath(ip_port);
|
||||||
//piCoutObj << "new tcp client" << sock_;
|
//piCoutObj << "new tcp client" << sock_;
|
||||||
|
|||||||
@@ -181,10 +181,10 @@ void PIThread::terminate() {
|
|||||||
terminating = running_ = false;
|
terminating = running_ = false;
|
||||||
#ifndef WINDOWS
|
#ifndef WINDOWS
|
||||||
# ifdef ANDROID
|
# ifdef ANDROID
|
||||||
pthread_kill(thread, SIGKILL);
|
pthread_kill(thread, SIGTERM);
|
||||||
# else
|
# else
|
||||||
//pthread_kill(thread, SIGKILL);
|
//pthread_kill(thread, SIGKILL);
|
||||||
void * ret(0);
|
//void * ret(0);
|
||||||
pthread_cancel(thread);
|
pthread_cancel(thread);
|
||||||
//pthread_join(thread, &ret);
|
//pthread_join(thread, &ret);
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
Reference in New Issue
Block a user