Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
fredix
ncs
Commits
fc7b5299
Commit
fc7b5299
authored
Apr 15, 2013
by
fred
Browse files
zerogw payload api refactoring : remove zmq::proxy to a no blocked router/dealer
parent
e344eb32
Changes
1
Hide whitespace changes
Inline
Side-by-side
service.cpp
View file @
fc7b5299
...
...
@@ -100,9 +100,8 @@ void ZerogwProxy::init()
void
ZerogwProxy
::
receive_zerogw
()
{
check_zerogw
->
setEnabled
(
false
);
qDebug
()
<<
"ZerogwProxy::receive_zerogw !!!!!!!!!"
;
int
counter
=
0
;
// qDebug() << "ZerogwProxy::receive_zerogw !!!!!!!!!";
//int counter=0;
while
(
true
)
{
...
...
@@ -110,7 +109,7 @@ void ZerogwProxy::receive_zerogw()
qint32
events
=
0
;
std
::
size_t
eventsSize
=
sizeof
(
events
);
qDebug
()
<<
"MULTIPART !!!!!!!!!! : "
<<
counter
;
//
qDebug() << "MULTIPART !!!!!!!!!! : " << counter;
// Process all parts of the message
//bool res = zerogw->recv(&message, ZMQ_NOBLOCK);
bool
res
=
zerogw
->
recv
(
&
message
,
ZMQ_NOBLOCK
);
...
...
@@ -120,12 +119,12 @@ void ZerogwProxy::receive_zerogw()
zerogw
->
getsockopt
(
ZMQ_RCVMORE
,
&
events
,
&
eventsSize
);
worker_payload
->
send
(
message
,
events
?
ZMQ_SNDMORE
:
0
);
std
::
cout
<<
"ZMQ_EVENTS : "
<<
events
<<
std
::
endl
;
//
std::cout << "ZMQ_EVENTS : " << events << std::endl;
QString
tmp
=
QString
::
fromAscii
((
char
*
)
message
.
data
(),
message
.
size
());
qDebug
()
<<
"MESSAGE "
<<
tmp
;
//
QString tmp = QString::fromAscii((char*)message.data(), message.size());
//
qDebug() << "MESSAGE " << tmp;
counter
++
;
//
counter++;
}
check_zerogw
->
setEnabled
(
true
);
}
...
...
@@ -136,9 +135,9 @@ void ZerogwProxy::receive_zerogw()
void
ZerogwProxy
::
reply_payload
()
{
check_reply
->
setEnabled
(
false
);
qDebug
()
<<
"ZerogwProxy::reply_payload !!!!!!!!!"
;
//
qDebug() << "ZerogwProxy::reply_payload !!!!!!!!!";
int
counter
=
0
;
//
int counter=0;
while
(
true
)
{
...
...
@@ -152,13 +151,13 @@ void ZerogwProxy::reply_payload()
worker_payload
->
getsockopt
(
ZMQ_RCVMORE
,
&
events
,
&
eventsSize
);
zerogw
->
send
(
message
,
events
?
ZMQ_SNDMORE
:
0
);
std
::
cout
<<
"ZMQ_EVENTS : "
<<
events
<<
std
::
endl
;
//
std::cout << "ZMQ_EVENTS : " << events << std::endl;
QString
tmp
=
QString
::
fromAscii
((
char
*
)
message
.
data
(),
message
.
size
());
qDebug
()
<<
"MESSAGE "
<<
tmp
;
//
QString tmp = QString::fromAscii((char*)message.data(), message.size());
//
qDebug() << "MESSAGE " << tmp;
counter
++
;
//
counter++;
}
check_reply
->
setEnabled
(
true
);
...
...
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