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
7460d00b
Commit
7460d00b
authored
Jun 29, 2013
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #598 from hurtonm/master
Use generic session class whenever possible
parents
1beec5e9
fd7e9b8c
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
6 additions
and
344 deletions
+6
-344
dealer.cpp
src/dealer.cpp
+0
-12
dealer.hpp
src/dealer.hpp
+0
-15
pair.cpp
src/pair.cpp
+0
-12
pair.hpp
src/pair.hpp
+0
-15
pub.cpp
src/pub.cpp
+0
-12
pub.hpp
src/pub.hpp
+0
-15
pull.cpp
src/pull.cpp
+0
-12
pull.hpp
src/pull.hpp
+0
-15
push.cpp
src/push.cpp
+0
-12
push.hpp
src/push.hpp
+0
-15
rep.cpp
src/rep.cpp
+0
-12
rep.hpp
src/rep.hpp
+0
-15
req.cpp
src/req.cpp
+4
-4
req.hpp
src/req.hpp
+1
-1
router.cpp
src/router.cpp
+0
-12
router.hpp
src/router.hpp
+0
-15
session_base.cpp
src/session_base.cpp
+1
-42
stream.cpp
src/stream.cpp
+0
-12
stream.hpp
src/stream.hpp
+0
-15
sub.cpp
src/sub.cpp
+0
-12
sub.hpp
src/sub.hpp
+0
-15
xpub.cpp
src/xpub.cpp
+0
-12
xpub.hpp
src/xpub.hpp
+0
-15
xsub.cpp
src/xsub.cpp
+0
-12
xsub.hpp
src/xsub.hpp
+0
-15
No files found.
src/dealer.cpp
View file @
7460d00b
...
...
@@ -113,15 +113,3 @@ void zmq::dealer_t::xpipe_terminated (pipe_t *pipe_)
fq
.
pipe_terminated
(
pipe_
);
lb
.
pipe_terminated
(
pipe_
);
}
zmq
::
dealer_session_t
::
dealer_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
session_base_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
dealer_session_t
::~
dealer_session_t
()
{
}
src/dealer.hpp
View file @
7460d00b
...
...
@@ -69,21 +69,6 @@ namespace zmq
const
dealer_t
&
operator
=
(
const
dealer_t
&
);
};
class
dealer_session_t
:
public
session_base_t
{
public
:
dealer_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
zmq
::
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
dealer_session_t
();
private
:
dealer_session_t
(
const
dealer_session_t
&
);
const
dealer_session_t
&
operator
=
(
const
dealer_session_t
&
);
};
}
#endif
src/pair.cpp
View file @
7460d00b
...
...
@@ -117,15 +117,3 @@ bool zmq::pair_t::xhas_out ()
return
pipe
->
check_write
();
}
zmq
::
pair_session_t
::
pair_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
session_base_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
pair_session_t
::~
pair_session_t
()
{
}
src/pair.hpp
View file @
7460d00b
...
...
@@ -57,21 +57,6 @@ namespace zmq
const
pair_t
&
operator
=
(
const
pair_t
&
);
};
class
pair_session_t
:
public
session_base_t
{
public
:
pair_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
pair_session_t
();
private
:
pair_session_t
(
const
pair_session_t
&
);
const
pair_session_t
&
operator
=
(
const
pair_session_t
&
);
};
}
#endif
src/pub.cpp
View file @
7460d00b
...
...
@@ -41,15 +41,3 @@ bool zmq::pub_t::xhas_in ()
{
return
false
;
}
zmq
::
pub_session_t
::
pub_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
xpub_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
pub_session_t
::~
pub_session_t
()
{
}
src/pub.hpp
View file @
7460d00b
...
...
@@ -47,21 +47,6 @@ namespace zmq
const
pub_t
&
operator
=
(
const
pub_t
&
);
};
class
pub_session_t
:
public
xpub_session_t
{
public
:
pub_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
zmq
::
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
pub_session_t
();
private
:
pub_session_t
(
const
pub_session_t
&
);
const
pub_session_t
&
operator
=
(
const
pub_session_t
&
);
};
}
#endif
src/pull.cpp
View file @
7460d00b
...
...
@@ -60,15 +60,3 @@ bool zmq::pull_t::xhas_in ()
{
return
fq
.
has_in
();
}
zmq
::
pull_session_t
::
pull_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
session_base_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
pull_session_t
::~
pull_session_t
()
{
}
src/pull.hpp
View file @
7460d00b
...
...
@@ -59,21 +59,6 @@ namespace zmq
};
class
pull_session_t
:
public
session_base_t
{
public
:
pull_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
pull_session_t
();
private
:
pull_session_t
(
const
pull_session_t
&
);
const
pull_session_t
&
operator
=
(
const
pull_session_t
&
);
};
}
#endif
src/push.cpp
View file @
7460d00b
...
...
@@ -60,15 +60,3 @@ bool zmq::push_t::xhas_out ()
{
return
lb
.
has_out
();
}
zmq
::
push_session_t
::
push_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
session_base_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
push_session_t
::~
push_session_t
()
{
}
src/push.hpp
View file @
7460d00b
...
...
@@ -58,21 +58,6 @@ namespace zmq
const
push_t
&
operator
=
(
const
push_t
&
);
};
class
push_session_t
:
public
session_base_t
{
public
:
push_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
push_session_t
();
private
:
push_session_t
(
const
push_session_t
&
);
const
push_session_t
&
operator
=
(
const
push_session_t
&
);
};
}
#endif
src/rep.cpp
View file @
7460d00b
...
...
@@ -121,15 +121,3 @@ bool zmq::rep_t::xhas_out ()
return
router_t
::
xhas_out
();
}
zmq
::
rep_session_t
::
rep_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
router_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
rep_session_t
::~
rep_session_t
()
{
}
src/rep.hpp
View file @
7460d00b
...
...
@@ -58,21 +58,6 @@ namespace zmq
};
class
rep_session_t
:
public
router_session_t
{
public
:
rep_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
zmq
::
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
rep_session_t
();
private
:
rep_session_t
(
const
rep_session_t
&
);
const
rep_session_t
&
operator
=
(
const
rep_session_t
&
);
};
}
#endif
src/req.cpp
View file @
7460d00b
...
...
@@ -137,7 +137,7 @@ bool zmq::req_t::xhas_out ()
zmq
::
req_session_t
::
req_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
dealer_session
_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
),
session_base
_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
),
state
(
bottom
)
{
}
...
...
@@ -152,15 +152,15 @@ int zmq::req_session_t::push_msg (msg_t *msg_)
case
bottom
:
if
(
msg_
->
flags
()
==
msg_t
::
more
&&
msg_
->
size
()
==
0
)
{
state
=
body
;
return
dealer_session
_t
::
push_msg
(
msg_
);
return
session_base
_t
::
push_msg
(
msg_
);
}
break
;
case
body
:
if
(
msg_
->
flags
()
==
msg_t
::
more
)
return
dealer_session
_t
::
push_msg
(
msg_
);
return
session_base
_t
::
push_msg
(
msg_
);
if
(
msg_
->
flags
()
==
0
)
{
state
=
bottom
;
return
dealer_session
_t
::
push_msg
(
msg_
);
return
session_base
_t
::
push_msg
(
msg_
);
}
break
;
}
...
...
src/req.hpp
View file @
7460d00b
...
...
@@ -58,7 +58,7 @@ namespace zmq
const
req_t
&
operator
=
(
const
req_t
&
);
};
class
req_session_t
:
public
dealer_session
_t
class
req_session_t
:
public
session_base
_t
{
public
:
...
...
src/router.cpp
View file @
7460d00b
...
...
@@ -406,15 +406,3 @@ bool zmq::router_t::identify_peer (pipe_t *pipe_)
return
true
;
}
zmq
::
router_session_t
::
router_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
session_base_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
router_session_t
::~
router_session_t
()
{
}
src/router.hpp
View file @
7460d00b
...
...
@@ -119,21 +119,6 @@ namespace zmq
const
router_t
&
operator
=
(
const
router_t
&
);
};
class
router_session_t
:
public
session_base_t
{
public
:
router_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
router_session_t
();
private
:
router_session_t
(
const
router_session_t
&
);
const
router_session_t
&
operator
=
(
const
router_session_t
&
);
};
}
#endif
src/session_base.cpp
View file @
7460d00b
...
...
@@ -30,17 +30,6 @@
#include "ctx.hpp"
#include "req.hpp"
#include "dealer.hpp"
#include "rep.hpp"
#include "router.hpp"
#include "pub.hpp"
#include "xpub.hpp"
#include "sub.hpp"
#include "xsub.hpp"
#include "push.hpp"
#include "pull.hpp"
#include "pair.hpp"
#include "stream.hpp"
zmq
::
session_base_t
*
zmq
::
session_base_t
::
create
(
class
io_thread_t
*
io_thread_
,
bool
connect_
,
class
socket_base_t
*
socket_
,
const
options_t
&
options_
,
...
...
@@ -53,47 +42,17 @@ zmq::session_base_t *zmq::session_base_t::create (class io_thread_t *io_thread_,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_DEALER
:
s
=
new
(
std
::
nothrow
)
dealer_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_REP
:
s
=
new
(
std
::
nothrow
)
rep_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_ROUTER
:
s
=
new
(
std
::
nothrow
)
router_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_PUB
:
s
=
new
(
std
::
nothrow
)
pub_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_XPUB
:
s
=
new
(
std
::
nothrow
)
xpub_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_SUB
:
s
=
new
(
std
::
nothrow
)
sub_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_XSUB
:
s
=
new
(
std
::
nothrow
)
xsub_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_PUSH
:
s
=
new
(
std
::
nothrow
)
push_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_PULL
:
s
=
new
(
std
::
nothrow
)
pull_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_PAIR
:
s
=
new
(
std
::
nothrow
)
pair_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
case
ZMQ_STREAM
:
s
=
new
(
std
::
nothrow
)
s
tream_session
_t
(
io_thread_
,
connect_
,
s
=
new
(
std
::
nothrow
)
s
ession_base
_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
);
break
;
default
:
...
...
src/stream.cpp
View file @
7460d00b
...
...
@@ -255,15 +255,3 @@ void zmq::stream_t::identify_peer (pipe_t *pipe_)
outpipes_t
::
value_type
(
identity
,
outpipe
)).
second
;
zmq_assert
(
ok
);
}
zmq
::
stream_session_t
::
stream_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
session_base_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
stream_session_t
::~
stream_session_t
()
{
}
src/stream.hpp
View file @
7460d00b
...
...
@@ -92,21 +92,6 @@ namespace zmq
const
stream_t
&
operator
=
(
const
stream_t
&
);
};
class
stream_session_t
:
public
session_base_t
{
public
:
stream_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
stream_session_t
();
private
:
stream_session_t
(
const
stream_session_t
&
);
const
stream_session_t
&
operator
=
(
const
stream_session_t
&
);
};
}
#endif
src/sub.cpp
View file @
7460d00b
...
...
@@ -78,15 +78,3 @@ bool zmq::sub_t::xhas_out ()
// Overload the XSUB's send.
return
false
;
}
zmq
::
sub_session_t
::
sub_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
xsub_session_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
sub_session_t
::~
sub_session_t
()
{
}
src/sub.hpp
View file @
7460d00b
...
...
@@ -49,21 +49,6 @@ namespace zmq
const
sub_t
&
operator
=
(
const
sub_t
&
);
};
class
sub_session_t
:
public
xsub_session_t
{
public
:
sub_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
zmq
::
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
sub_session_t
();
private
:
sub_session_t
(
const
sub_session_t
&
);
const
sub_session_t
&
operator
=
(
const
sub_session_t
&
);
};
}
#endif
src/xpub.cpp
View file @
7460d00b
...
...
@@ -189,15 +189,3 @@ void zmq::xpub_t::send_unsubscription (unsigned char *data_, size_t size_,
self
->
pending_flags
.
push_back
(
0
);
}
}
zmq
::
xpub_session_t
::
xpub_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
session_base_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
xpub_session_t
::~
xpub_session_t
()
{
}
src/xpub.hpp
View file @
7460d00b
...
...
@@ -89,21 +89,6 @@ namespace zmq
const
xpub_t
&
operator
=
(
const
xpub_t
&
);
};
class
xpub_session_t
:
public
session_base_t
{
public
:
xpub_session_t
(
zmq
::
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
xpub_session_t
();
private
:
xpub_session_t
(
const
xpub_session_t
&
);
const
xpub_session_t
&
operator
=
(
const
xpub_session_t
&
);
};
}
#endif
src/xsub.cpp
View file @
7460d00b
...
...
@@ -226,15 +226,3 @@ void zmq::xsub_t::send_subscription (unsigned char *data_, size_t size_,
if
(
!
sent
)
msg
.
close
();
}
zmq
::
xsub_session_t
::
xsub_session_t
(
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
)
:
session_base_t
(
io_thread_
,
connect_
,
socket_
,
options_
,
addr_
)
{
}
zmq
::
xsub_session_t
::~
xsub_session_t
()
{
}
src/xsub.hpp
View file @
7460d00b
...
...
@@ -86,21 +86,6 @@ namespace zmq
const
xsub_t
&
operator
=
(
const
xsub_t
&
);
};
class
xsub_session_t
:
public
session_base_t
{
public
:
xsub_session_t
(
class
io_thread_t
*
io_thread_
,
bool
connect_
,
socket_base_t
*
socket_
,
const
options_t
&
options_
,
const
address_t
*
addr_
);
~
xsub_session_t
();
private
:
xsub_session_t
(
const
xsub_session_t
&
);
const
xsub_session_t
&
operator
=
(
const
xsub_session_t
&
);
};
}
#endif
...
...
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