BIG changes added

git-svn-id: svn://db.shs.com.ru/pip@129 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-05-15 12:04:50 +00:00
parent 673a974c1e
commit b2c9023deb
3 changed files with 17 additions and 3 deletions

View File

@@ -71,6 +71,13 @@ void __sighandler__(PISignals::Signal s) {
}
#ifdef ANDROID
void android_thread_exit_handler(int sig) {
pthread_exit(0);
}
#endif
PIInit::PIInit() {
PISystemInfo * sinfo = PISystemInfo::instance();
sinfo->execDateTime = PIDateTime::current();
@@ -129,6 +136,13 @@ PIInit::PIInit() {
setlocale(LC_ALL, "");
setlocale(LC_NUMERIC, "C");
# 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
#ifdef PIP_ICU
__syslocname__ = __sysoemname__ = 0;

View File

@@ -106,7 +106,7 @@ PIEthernet::PIEthernet(int sock_, PIString ip_port): PIIODevice("", ReadWrite) {
parseAddress(ip_port, &ip_s, &port_s);
sock = sock_;
init_ = opened_ = connected_ = true;
setParameters(PIEthernet::ReuseAddress | PIEthernet::MulticastLoop | PIEthernet::KeepConnection);
setParameters(PIEthernet::ReuseAddress | PIEthernet::MulticastLoop);
setType(TCP_Client, false);
setPath(ip_port);
//piCoutObj << "new tcp client" << sock_;

View File

@@ -181,10 +181,10 @@ void PIThread::terminate() {
terminating = running_ = false;
#ifndef WINDOWS
# ifdef ANDROID
pthread_kill(thread, SIGKILL);
pthread_kill(thread, SIGTERM);
# else
//pthread_kill(thread, SIGKILL);
void * ret(0);
//void * ret(0);
pthread_cancel(thread);
//pthread_join(thread, &ret);
# endif