Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ipc
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Scott Snyder
ipc
Commits
95cda253
Commit
95cda253
authored
3 years ago
by
Serguei Kolos
Browse files
Options
Downloads
Patches
Plain Diff
Add Bidir GIOP support
parent
f339176b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ipc/core.h
+3
-0
3 additions, 0 deletions
ipc/core.h
ipc/objectadapter.h
+9
-1
9 additions, 1 deletion
ipc/objectadapter.h
src/core.cc
+38
-6
38 additions, 6 deletions
src/core.cc
with
50 additions
and
7 deletions
ipc/core.h
+
3
−
0
View file @
95cda253
...
...
@@ -54,6 +54,8 @@ class IPCCore
static
bool
isInitialised
()
throw
();
static
bool
isBidirUsed
()
throw
();
static
CORBA
::
ORB_var
getORB
();
static
PortableServer
::
POA_var
getRootPOA
();
...
...
@@ -66,6 +68,7 @@ class IPCCore
static
void
atExitFun
();
static
bool
s_at_exit_registered
;
static
bool
s_bidir_used
;
static
boost
::
mutex
*
s_guard
;
static
CORBA
::
ORB_ptr
s_orb_instance
;
static
PortableServer
::
POA_ptr
s_root_poa
;
...
...
This diff is collapsed.
Click to expand it.
ipc/objectadapter.h
+
9
−
1
View file @
95cda253
...
...
@@ -67,7 +67,7 @@ private:
template
<
class
T
,
class
TP
,
class
PP
>
IPCObjectAdapter
::
IPCObjectAdapter
(
IPCObjectBase
<
T
,
TP
,
PP
>
*
object
)
{
CORBA
::
PolicyList
pl
(
6
);
CORBA
::
PolicyList
pl
(
7
);
pl
.
length
(
6
);
PortableServer
::
POA_var
root_poa
=
IPCCore
::
getRootPOA
();
...
...
@@ -79,6 +79,14 @@ IPCObjectAdapter::IPCObjectAdapter(IPCObjectBase<T, TP, PP> * object)
pl
[
4
]
=
root_poa
->
create_servant_retention_policy
(
PortableServer
::
RETAIN
);
pl
[
5
]
=
root_poa
->
create_id_uniqueness_policy
(
PortableServer
::
UNIQUE_ID
);
if
(
IPCCore
::
isBidirUsed
())
{
CORBA
::
ORB_var
orb
=
IPCCore
::
getORB
();
CORBA
::
Any
bidir
;
bidir
<<=
BiDirPolicy
::
BOTH
;
pl
.
length
(
7
);
pl
[
6
]
=
orb
->
create_policy
(
BiDirPolicy
::
BIDIRECTIONAL_POLICY_TYPE
,
bidir
);
}
std
::
string
poa_id
=
ipc
::
util
::
getTypeName
(
object
)
+
object
->
poa_id_suffix
();
try
{
...
...
This diff is collapsed.
Click to expand it.
src/core.cc
+
38
−
6
View file @
95cda253
...
...
@@ -28,6 +28,7 @@ namespace ipc
}
bool
IPCCore
::
s_at_exit_registered
=
false
;
bool
IPCCore
::
s_bidir_used
=
false
;
boost
::
mutex
*
IPCCore
::
s_guard
=
new
boost
::
mutex
();
CORBA
::
ORB_ptr
IPCCore
::
s_orb_instance
;
PortableServer
::
POA_ptr
IPCCore
::
s_root_poa
;
...
...
@@ -163,7 +164,8 @@ IPCCore::extractOptions( int & argc, char ** argv )
}
catch
(
const
omni
::
orbOptions
::
BadParam
&
ex
)
{
throw
daq
::
ipc
::
BadOptionValue
(
ERS_HERE
,
(
const
char
*
)
ex
.
key
,
(
const
char
*
)
ex
.
value
,
(
const
char
*
)
ex
.
why
);
throw
daq
::
ipc
::
BadOptionValue
(
ERS_HERE
,
(
const
char
*
)
ex
.
key
,
(
const
char
*
)
ex
.
value
,
(
const
char
*
)
ex
.
why
);
}
omni
::
orbOptions
::
sequenceString_var
newOpts
;
...
...
@@ -205,6 +207,8 @@ IPCCore::init( const std::list< std::pair< std::string, std::string > > & opt )
throw
daq
::
ipc
::
AlreadyInitialized
(
ERS_HERE
);
}
s_bidir_used
=
getenv
(
"TDAQ_IPC_USE_BIDIR"
)
!=
0
;
///////////////////////////////////
// check and set the timeout value
///////////////////////////////////
...
...
@@ -217,12 +221,13 @@ IPCCore::init( const std::list< std::pair< std::string, std::string > > & opt )
in
>>
val
;
if
(
val
<
1000
)
{
throw
daq
::
ipc
::
BadOptionValue
(
ERS_HERE
,
"Timeout"
,
env
,
"It must be more then 1000 milliseconds."
);
throw
daq
::
ipc
::
BadOptionValue
(
ERS_HERE
,
"Timeout"
,
env
,
"It must be more then 1000 milliseconds."
);
}
timeout
=
env
;
}
const
char
*
(
*
options
)[
2
]
=
new
const
char
*
[
opt
.
size
()
+
4
][
2
];
const
char
*
(
*
options
)[
2
]
=
new
const
char
*
[
opt
.
size
()
+
10
][
2
];
int
idx
=
0
;
options
[
idx
][
0
]
=
"clientCallTimeOutPeriod"
;
options
[
idx
][
1
]
=
timeout
.
c_str
();
...
...
@@ -233,9 +238,28 @@ IPCCore::init( const std::list< std::pair< std::string, std::string > > & opt )
options
[
idx
][
0
]
=
"verifyObjectExistsAndType"
;
options
[
idx
][
1
]
=
"0"
;
idx
++
;
options
[
idx
][
0
]
=
"supportCurrent"
;
options
[
idx
][
1
]
=
"0"
;
idx
++
;
if
(
s_bidir_used
)
{
options
[
idx
][
0
]
=
"offerBiDirectionalGIOP"
;
options
[
idx
][
1
]
=
"1"
;
idx
++
;
options
[
idx
][
0
]
=
"acceptBiDirectionalGIOP"
;
options
[
idx
][
1
]
=
"1"
;
idx
++
;
options
[
idx
][
0
]
=
"clientTransportRule"
;
options
[
idx
][
1
]
=
"* unix,tcp,bidir"
;
idx
++
;
options
[
idx
][
0
]
=
"serverTransportRule"
;
options
[
idx
][
1
]
=
"* unix,tcp,bidir"
;
idx
++
;
options
[
idx
][
0
]
=
"supportCurrent"
;
options
[
idx
][
1
]
=
"1"
;
idx
++
;
}
else
{
options
[
idx
][
0
]
=
"supportCurrent"
;
options
[
idx
][
1
]
=
"0"
;
idx
++
;
}
for
(
list
<
pair
<
string
,
string
>
>::
const_iterator
it
=
opt
.
begin
();
it
!=
opt
.
end
();
++
idx
,
++
it
)
{
...
...
@@ -366,6 +390,14 @@ IPCCore::isInitialised() throw()
return
(
!
CORBA
::
is_nil
(
s_orb_instance
)
&&
!
CORBA
::
is_nil
(
s_root_poa
)
);
}
bool
IPCCore
::
isBidirUsed
()
throw
()
{
boost
::
mutex
::
scoped_lock
ml
(
*
s_guard
);
return
s_bidir_used
;
}
CORBA
::
ORB_var
IPCCore
::
getORB
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment