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
5d0cbe02
Commit
5d0cbe02
authored
Dec 13, 2021
by
legoc
Browse files
Corrected output stream
parent
cf3314a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
cameo-api-cpp/src/base/OutputStreamSocket.cpp
View file @
5d0cbe02
...
...
@@ -46,6 +46,7 @@ OutputStreamSocket::OutputStreamSocket(Server * server, const std::string& name)
//TODO Replace with factory.
m_impl
=
std
::
unique_ptr
<
StreamSocketImpl
>
(
new
OutputStreamSocketZmq
(
server
,
name
));
m_impl
->
init
();
}
OutputStreamSocket
::~
OutputStreamSocket
()
{
...
...
cameo-api-cpp/src/base/impl/zmq/OutputStreamSocketZmq.cpp
View file @
5d0cbe02
...
...
@@ -37,8 +37,8 @@ OutputStreamSocketZmq::~OutputStreamSocketZmq() {
void
OutputStreamSocketZmq
::
init
()
{
int
port
=
m_server
->
getStreamPort
(
m_name
);
if
(
port
==
-
1
)
{
std
::
cerr
<<
"No stream port for "
<<
m_name
<<
std
::
endl
;
return
;
}
...
...
@@ -49,7 +49,7 @@ void OutputStreamSocketZmq::init() {
// Create the sockets.
m_cancelSocket
.
reset
(
m_context
->
createCancelPublisher
(
cancelEndpoint
.
str
()));
m_socket
.
reset
(
m_context
->
create
Event
Subscriber
(
m_server
->
getEndpoint
().
withPort
(
port
).
toString
(),
cancelEndpoint
.
str
()));
m_socket
.
reset
(
m_context
->
create
OutputStream
Subscriber
(
m_server
->
getEndpoint
().
withPort
(
port
).
toString
(),
cancelEndpoint
.
str
()));
// Wait for the connection to be ready.
// Poll subscriber.
...
...
@@ -81,6 +81,7 @@ std::string OutputStreamSocketZmq::receive(bool blocking) {
// Use the message interface.
unique_ptr
<
zmq
::
message_t
>
message
(
new
zmq
::
message_t
());
if
(
m_socket
->
recv
(
message
.
get
(),
(
blocking
?
0
:
ZMQ_DONTWAIT
)))
{
// The message exists.
return
std
::
string
(
message
->
data
<
char
>
(),
message
->
size
());
...
...
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