Преглед на файлове

change modulecomm. default use group notify.

yuchuli преди 3 години
родител
ревизия
ac0ac28962

+ 10 - 9
src/common/ivservice/main.cpp

@@ -59,7 +59,7 @@ void threadclientai(int ai)
 }
 void threadclient()
 {
-    iv::service::Client xclient("hellob");
+    iv::service::Client xclient("helloa");
 
 //    std::this_thread::sleep_for(std::chrono::milliseconds(3));
     std::cout<<"Send Time : "<<QDateTime::currentMSecsSinceEpoch()<<std::endl;
@@ -75,7 +75,7 @@ void threadclient()
     {
         std::cout<<" Fail Get Result."<<std::endl;
     }
-    return ;
+ //   return ;
     int nsendsize = 100;
     while(nsendsize < 1000000)
     {
@@ -111,19 +111,20 @@ int main(int argc, char *argv[])
     qint64 xtime1 = std::chrono::system_clock::now().time_since_epoch().count();
     qint64 xtime2 = std::chrono::system_clock::now().time_since_epoch().count();
     qint64 xtd = xtime2 - xtime1;
-//    iv::service::Server xserver("helloa",ProcReq);
-//    std::this_thread::sleep_for(std::chrono::milliseconds(300));
+    iv::service::Server xserver("helloa",ProcReq);
+    std::this_thread::sleep_for(std::chrono::milliseconds(300));
+    std::thread * pthread = new std::thread(threadclient);
 //    std::thread * pthread_a = new std::thread(threadclientai,1);
 //    std::thread * pthread_b = new std::thread(threadclientai,2);
 
 
 
-    iv::service::Client xaync("async");
-    std::shared_ptr<char> pstr_async = std::shared_ptr<char>(new char[1000]);
-    xaync.AsyncSendRequest(pstr_async,100,ProcAsync);
+//    iv::service::Client xaync("async");
+//    std::shared_ptr<char> pstr_async = std::shared_ptr<char>(new char[1000]);
+//    xaync.AsyncSendRequest(pstr_async,100,ProcAsync);
 
-    std::this_thread::sleep_for(std::chrono::milliseconds(10000));
-    iv::service::Server xserver("async",ProcReq);
+//    std::this_thread::sleep_for(std::chrono::milliseconds(10000));
+//    iv::service::Server xserver("async",ProcReq);
 
 
 

+ 4 - 1
src/common/modulecomm/fastrtps/TopicsSubscriber.cxx

@@ -63,6 +63,7 @@ bool TopicsSubscriber::init(const char * strtopic,const char * strpubip,const un
     strncpy(mstrtopic,strtopic,255);
     // Create RTPSParticipant
 
+
     ParticipantAttributes PParam;
     PParam.rtps.setName("Participant_subscriber"); //You can put the name you want
 
@@ -72,6 +73,7 @@ bool TopicsSubscriber::init(const char * strtopic,const char * strpubip,const un
     PParam.rtps.builtin.discovery_config.m_simpleEDP.use_PublicationWriterANDSubscriptionReader = true;
     PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
 
+
     // SharedMem transport configuration
     PParam.rtps.useBuiltinTransports = false;
 
@@ -97,6 +99,8 @@ bool TopicsSubscriber::init(const char * strtopic,const char * strpubip,const un
         initial_peer_locator.port = nPort;
         PParam.rtps.builtin.initialPeersList.push_back(initial_peer_locator);
 
+
+
     //    PParam.rtps.builtin.discovery_config.leaseDuration = c_TimeInfinite;
     //    PParam.rtps.builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(5, 0);
     //    PParam.rtps.setName("Participant_sub");
@@ -130,7 +134,6 @@ bool TopicsSubscriber::init(const char * strtopic,const char * strpubip,const un
 
     Rparam.qos.m_reliability.kind = RELIABLE_RELIABILITY_QOS;
 
-
     mp_subscriber = Domain::createSubscriber(mp_participant,Rparam, static_cast<SubscriberListener*>(&m_listener));
     if(mp_subscriber == nullptr)
     {

+ 7 - 2
src/common/modulecomm/modulecomm.pro

@@ -1,6 +1,6 @@
 QT -= gui
 
-QT += dbus
+#QT += dbus
 QT += xml
 
 
@@ -16,11 +16,16 @@ unix:system("./../../../include/linuxsystemtest.sh ")
 unix:include(./../../../include/systemdef.pri)
 win32: DEFINES += SYSTEM_WIN
 
+DEFINES += USE_GROUPUDP
 
 if(contains(DEFINES,USE_GROUPUDP)){
 QT += network
-}
+} else {
+QT += dbus
 DEFINES += USEDBUS
+}
+
+
 
 CONFIG += c++11
 

+ 1 - 1
src/common/modulecomm/shm/procsm_if.cpp

@@ -471,7 +471,7 @@ void procsm_if::ThreadGroupRecv()
                 }
                 else
                 {
-                    std::cout<<"key error"<<std::endl;
+//                    std::cout<<"key error"<<std::endl;
                 }
             }
   //          return info->DeserializeFrom(buf, nbytes);