mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-17 12:58:12 +08:00
problem: dgram doesn't need to prefetch messages
This commit is contained in:
parent
d791932635
commit
47c0b6ec25
@ -40,7 +40,6 @@ zmq::dgram_t::dgram_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
|
||||
socket_base_t (parent_, tid_, sid_),
|
||||
pipe (NULL),
|
||||
last_in (NULL),
|
||||
prefetched (false),
|
||||
more_out (false)
|
||||
{
|
||||
options.type = ZMQ_DGRAM;
|
||||
@ -148,24 +147,11 @@ int zmq::dgram_t::xrecv (msg_t *msg_)
|
||||
}
|
||||
last_in = pipe;
|
||||
|
||||
if (prefetched) {
|
||||
msg_->reset_flags (msg_t::more);
|
||||
prefetched = false;
|
||||
}
|
||||
else {
|
||||
msg_->set_flags (msg_t::more);
|
||||
prefetched = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool zmq::dgram_t::xhas_in ()
|
||||
{
|
||||
// We may already have a message pre-fetched.
|
||||
if (prefetched)
|
||||
return true;
|
||||
|
||||
if (!pipe)
|
||||
return false;
|
||||
|
||||
|
@ -69,9 +69,6 @@ namespace zmq
|
||||
|
||||
blob_t saved_credential;
|
||||
|
||||
// True iff there is a message held in the pre-fetch buffer.
|
||||
bool prefetched;
|
||||
|
||||
// If true, more outgoing message parts are expected.
|
||||
bool more_out;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user