open methods refined

This commit is contained in:
2017-11-22 14:12:01 +01:00
parent 350ddab997
commit 52fe50f14a
8 changed files with 3086 additions and 21 deletions

View File

@@ -122,6 +122,8 @@ int Connect::createChannel(unsigned int handle, const char * pv, chid &pCh) {
ptime timeEnd(microsec_clock::local_time());
time_duration duration(timeEnd-timeStart);
timeElapsed= (double) duration.total_microseconds()/1000000.0;
//cout << "channelOpenPolicy.getTimeout() " << channelOpenPolicy.getTimeout() << endl;
while ( !(*it_handle).isConnected() && timeElapsed <= channelOpenPolicy.getTimeout()){
@@ -141,18 +143,22 @@ int Connect::createChannel(unsigned int handle, const char * pv, chid &pCh) {
}
/*
/*
if ( (*it_handle).isConnected() ) {
cout << (*it_handle).getPV() << " // is connected //" << endl;
}
else {
cout << (*it_handle).getPV() << " // is not connected //" << endl;
}
cout << "timeElapsed for open " << timeElapsed << " nPoll = " << nPoll << endl;
cout << "timeElapsed for open " << timeElapsed << " nPoll = " << nPoll << endl;
*/
}
//else {
//cout << "channelOpenPolicy.getWhenToFlushSendBuffer() is " << channelOpenPolicy.getWhenToFlushSendBuffer() << endl;
//}
// Peculiar if true
/*
@@ -468,7 +474,9 @@ int Connect::open(const char ** pvArray, unsigned int * handleArray,
}
catch (CAFEException_open &e) {
if (flushAtEndFlag) {
channelOpenPolicy.flushSendBufferNow(); //this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
//channelOpenPolicy.flushSendBufferNow();
//this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
Connect::openNow();
}
throw(e);
@@ -477,7 +485,9 @@ int Connect::open(const char ** pvArray, unsigned int * handleArray,
}
if (flushAtEndFlag) {
channelOpenPolicy.flushSendBufferNow(); //this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
//channelOpenPolicy.flushSendBufferNow();
//this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
Connect::openNow();
}
return ICAFE_NORMAL;
@@ -519,7 +529,9 @@ int Connect::open(const string *pvArrayS, unsigned int *handleArray, const unsi
}
catch (CAFEException_open &e) {
if (flushAtEndFlag) {
channelOpenPolicy.flushSendBufferNow(); //this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
//channelOpenPolicy.flushSendBufferNow();
//this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
Connect::openNow();
}
throw(e);
@@ -528,7 +540,9 @@ int Connect::open(const string *pvArrayS, unsigned int *handleArray, const unsi
}
if (flushAtEndFlag) {
channelOpenPolicy.flushSendBufferNow(); //this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
//channelOpenPolicy.flushSendBufferNow();
//this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
Connect::openNow();
}
return ICAFE_NORMAL;
@@ -575,7 +589,9 @@ int Connect::open(vector<string> pvV, vector<unsigned int> &handleV)
}
catch (CAFEException_open &e) {
if (flushAtEndFlag) {
channelOpenPolicy.flushSendBufferNow(); //this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
//channelOpenPolicy.flushSendBufferNow();
//this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
Connect::openNow();
}
throw(e);
@@ -584,7 +600,9 @@ int Connect::open(vector<string> pvV, vector<unsigned int> &handleV)
}
if (flushAtEndFlag) {
channelOpenPolicy.flushSendBufferNow(); //this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
//channelOpenPolicy.flushSendBufferNow();
//this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
Connect::openNow();
}
return ICAFE_NORMAL;
@@ -630,7 +648,9 @@ int Connect::open(vector<const char *> pvV, vector<unsigned int> &handleV)
}
catch (CAFEException_open &e) {
if (flushAtEndFlag) {
channelOpenPolicy.flushSendBufferNow(); //this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
//channelOpenPolicy.flushSendBufferNow();
//this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
Connect::openNow();
}
throw(e);
@@ -639,7 +659,9 @@ int Connect::open(vector<const char *> pvV, vector<unsigned int> &handleV)
}
if (flushAtEndFlag) {
channelOpenPolicy.flushSendBufferNow(); //this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
//channelOpenPolicy.flushSendBufferNow();
//this also resets whenKind=FLUSH_AFTER_EACH_CHANNEL_CREATION
Connect::openNow();
}

3043
src/connect.cpp- Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -207,7 +207,7 @@ htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/install-sh
libdir = /opt/gfa/cafe/cpp/cafe-1.5.0-final-1/lib
libdir = /opt/gfa/cafe/cpp/cafe-1.5.0-final-2/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
@@ -216,7 +216,7 @@ mandir = ${datarootdir}/man
mkdir_p = /bin/mkdir -p
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /opt/gfa/cafe/cpp/cafe-1.5.0-final-1
prefix = /opt/gfa/cafe/cpp/cafe-1.5.0-final-2
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin