Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Cameo
cameo
Commits
56796d2f
Commit
56796d2f
authored
Aug 11, 2020
by
legoc
Browse files
More traces
parent
646859a5
Changes
2
Show whitespace changes
Inline
Side-by-side
cameo-api-cpp/src/cameo/Server.cpp
View file @
56796d2f
...
...
@@ -61,7 +61,7 @@ Server::Server(const std::string& endpoint, int timeoutMs) :
m_eventThread
->
start
();
}
catch
(...)
{
// ...
cerr
<<
"Error while opening event stream"
<<
endl
;
}
}
...
...
cameo-api-cpp/src/cameo/impl/RequestSocketImpl.cpp
View file @
56796d2f
...
...
@@ -49,6 +49,9 @@ void RequestSocketImpl::setTimeout(int timeout) {
}
void
RequestSocketImpl
::
setSocketLinger
()
{
cerr
<<
this
<<
" RequestSocketImpl::setSocketLinger "
<<
m_socket
.
get
()
<<
endl
;
// Set the linger in case of timeout.
// If not, the context can block indefinitely.
// Does the value 100 can lead to a side-effect? A too small value like 1 has some side-effect.
...
...
@@ -62,27 +65,37 @@ void RequestSocketImpl::setSocketLinger() {
void
RequestSocketImpl
::
init
()
{
cerr
<<
this
<<
" RequestSocketImpl::init"
<<
endl
;
// Reset if the socket is null.
if
(
m_socket
.
get
()
==
nullptr
)
{
cerr
<<
this
<<
" RequestSocketImpl::init null"
<<
endl
;
m_socket
.
reset
(
m_services
->
createRequestSocket
(
m_endpoint
));
if
(
m_socket
.
get
()
==
nullptr
)
{
cerr
<<
this
<<
" RequestSocketImpl::init null"
<<
endl
;
cerr
<<
this
<<
" RequestSocketImpl::init
still
null"
<<
endl
;
}
// Apply the linger to the socket.
setSocketLinger
();
}
else
{
cerr
<<
this
<<
" RequestSocketImpl::init already done"
<<
endl
;
}
}
void
RequestSocketImpl
::
reset
()
{
m_socket
.
reset
();
cerr
<<
this
<<
" RequestSocketImpl::reset
"
<<
endl
;
cerr
<<
this
<<
" RequestSocketImpl::reset
"
<<
m_socket
.
get
()
<<
endl
;
}
std
::
unique_ptr
<
zmq
::
message_t
>
RequestSocketImpl
::
request
(
const
std
::
string
&
requestTypePart
,
const
std
::
string
&
requestDataPart
,
int
overrideTimeout
)
{
cerr
<<
this
<<
" RequestSocketImpl::request"
<<
endl
;
// Init if not already done or if a timeout occurred.
init
();
...
...
@@ -117,6 +130,9 @@ std::unique_ptr<zmq::message_t> RequestSocketImpl::request(const std::string& re
int
rc
=
zmq
::
poll
(
items
,
1
,
timeout
);
if
(
rc
==
0
)
{
cerr
<<
this
<<
" RequestSocketImpl::request timeout"
<<
endl
;
// Reset the socket. It is necessary if a new request is done.
reset
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment