Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
d8430f4b
Commit
d8430f4b
authored
Feb 12, 2010
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Multi-hop REQ/REP, part IV., add command deallocation mechanism
parent
313b5dfa
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
7 deletions
+43
-7
Makefile.am
src/Makefile.am
+1
-0
command.cpp
src/command.cpp
+24
-0
command.hpp
src/command.hpp
+3
-0
dispatcher.cpp
src/dispatcher.cpp
+4
-0
object.cpp
src/object.cpp
+11
-7
No files found.
src/Makefile.am
View file @
d8430f4b
...
...
@@ -125,6 +125,7 @@ libzmq_la_SOURCES = app_thread.hpp \
zmq_init.hpp
\
zmq_listener.hpp
\
app_thread.cpp
\
command.cpp
\
devpoll.cpp
\
dispatcher.cpp
\
downstream.cpp
\
...
...
src/command.cpp
0 → 100644
View file @
d8430f4b
/*
Copyright (c) 2007-2010 iMatix Corporation
This file is part of 0MQ.
0MQ is free software; you can redistribute it and/or modify it under
the terms of the Lesser GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
0MQ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Lesser GNU General Public License for more details.
You should have received a copy of the Lesser GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "command.hpp"
void
zmq
::
deallocate_command
(
command_t
*
cmd_
)
{
}
src/command.hpp
View file @
d8430f4b
...
...
@@ -107,6 +107,9 @@ namespace zmq
}
args
;
};
// Function to deallocate dynamically allocated components of the command.
void
deallocate_command
(
command_t
*
cmd_
);
}
#endif
src/dispatcher.cpp
View file @
d8430f4b
...
...
@@ -117,6 +117,10 @@ zmq::dispatcher_t::~dispatcher_t ()
while
(
!
pipes
.
empty
())
delete
*
pipes
.
begin
();
// TODO: Deallocate any commands still in the pipes. Keep in mind that
// simple reading from a pipe and deallocating commands won't do as
// command pipe has template parameter D set to true, meaning that
// read may return false even if there are still commands in the pipe.
delete
[]
command_pipes
;
#ifdef ZMQ_HAVE_WINDOWS
...
...
src/object.cpp
View file @
d8430f4b
...
...
@@ -77,17 +77,17 @@ void zmq::object_t::process_command (command_t &cmd_)
case
command_t
:
:
own
:
process_own
(
cmd_
.
args
.
own
.
object
);
return
;
break
;
case
command_t
:
:
attach
:
process_attach
(
cmd_
.
args
.
attach
.
engine
);
process_seqnum
();
return
;
break
;
case
command_t
:
:
bind
:
process_bind
(
cmd_
.
args
.
bind
.
in_pipe
,
cmd_
.
args
.
bind
.
out_pipe
);
process_seqnum
();
return
;
break
;
case
command_t
:
:
pipe_term
:
process_pipe_term
();
...
...
@@ -95,23 +95,27 @@ void zmq::object_t::process_command (command_t &cmd_)
case
command_t
:
:
pipe_term_ack
:
process_pipe_term_ack
();
return
;
break
;
case
command_t
:
:
term_req
:
process_term_req
(
cmd_
.
args
.
term_req
.
object
);
return
;
break
;
case
command_t
:
:
term
:
process_term
();
return
;
break
;
case
command_t
:
:
term_ack
:
process_term_ack
();
return
;
break
;
default
:
zmq_assert
(
false
);
}
// The assumption here is that each command is processed once only,
// so deallocating it after processing is all right.
deallocate_command
(
&
cmd_
);
}
void
zmq
::
object_t
::
register_pipe
(
class
pipe_t
*
pipe_
)
...
...
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