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
7e125117
Commit
7e125117
authored
Jul 11, 2011
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experimental code from zmq_init_t removed.
Signed-off-by:
Martin Sustrik
<
sustrik@250bpm.com
>
parent
52eaf600
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
51 deletions
+17
-51
zmq_init.cpp
src/zmq_init.cpp
+17
-44
zmq_init.hpp
src/zmq_init.hpp
+0
-7
No files found.
src/zmq_init.cpp
View file @
7e125117
...
@@ -51,28 +51,20 @@ zmq::zmq_init_t::zmq_init_t (io_thread_t *io_thread_,
...
@@ -51,28 +51,20 @@ zmq::zmq_init_t::zmq_init_t (io_thread_t *io_thread_,
peer_identity
[
0
]
=
0
;
peer_identity
[
0
]
=
0
;
generate_uuid
(
&
peer_identity
[
1
]);
generate_uuid
(
&
peer_identity
[
1
]);
// Create a list of props to send.
// Create a list of messages to send on connection initialisation.
msg_t
msg
;
int
rc
=
msg
.
init_size
(
4
);
errno_assert
(
rc
==
0
);
unsigned
char
*
data
=
(
unsigned
char
*
)
msg
.
data
();
put_uint16
(
data
,
prop_type
);
put_uint16
(
data
+
2
,
options
.
type
);
msg
.
set_flags
(
msg_t
::
more
);
to_send
.
push_back
(
msg
);
if
(
!
options
.
identity
.
empty
())
{
if
(
!
options
.
identity
.
empty
())
{
rc
=
msg
.
init_size
(
2
+
options
.
identity
.
size
());
msg_t
msg
;
int
rc
=
msg
.
init_size
(
options
.
identity
.
size
());
errno_assert
(
rc
==
0
);
memcpy
(
msg
.
data
()
,
options
.
identity
.
data
(),
msg
.
size
());
to_send
.
push_back
(
msg
);
}
else
{
msg_t
msg
;
int
rc
=
msg
.
init
();
errno_assert
(
rc
==
0
);
errno_assert
(
rc
==
0
);
data
=
(
unsigned
char
*
)
msg
.
data
();
put_uint16
(
data
,
prop_identity
);
memcpy
(
data
+
2
,
options
.
identity
.
data
(),
options
.
identity
.
size
());
msg
.
set_flags
(
msg_t
::
more
);
to_send
.
push_back
(
msg
);
to_send
.
push_back
(
msg
);
}
}
// Remove the MORE flag from the last prop.
to_send
.
back
().
reset_flags
(
msg_t
::
more
);
}
}
zmq
::
zmq_init_t
::~
zmq_init_t
()
zmq
::
zmq_init_t
::~
zmq_init_t
()
...
@@ -112,35 +104,16 @@ bool zmq::zmq_init_t::write (msg_t *msg_)
...
@@ -112,35 +104,16 @@ bool zmq::zmq_init_t::write (msg_t *msg_)
if
(
received
)
if
(
received
)
return
false
;
return
false
;
// Retrieve the peer's identity, if any.
zmq_assert
(
!
(
msg_
->
flags
()
&
msg_t
::
more
));
size_t
size
=
msg_
->
size
();
size_t
size
=
msg_
->
size
();
unsigned
char
*
data
=
(
unsigned
char
*
)
msg_
->
data
();
if
(
size
)
{
unsigned
char
*
data
=
(
unsigned
char
*
)
msg_
->
data
();
// There should be at least property type in the message.
peer_identity
.
assign
(
data
,
size
);
zmq_assert
(
size
>=
2
);
uint16_t
prop
=
get_uint16
(
data
);
switch
(
prop
)
{
case
prop_type
:
{
zmq_assert
(
size
==
4
);
// TODO: Check whether the type is OK.
// uint16_t type = get_uint16 (data + 2);
// ...
break
;
};
case
prop_identity
:
{
peer_identity
.
assign
(
data
+
2
,
size
-
2
);
break
;
}
default
:
zmq_assert
(
false
);
}
}
if
(
!
(
msg_
->
flags
()
&
msg_t
::
more
))
{
received
=
true
;
received
=
true
;
finalise_initialisation
();
finalise_initialisation
();
}
return
true
;
return
true
;
}
}
...
...
src/zmq_init.hpp
View file @
7e125117
...
@@ -47,13 +47,6 @@ namespace zmq
...
@@ -47,13 +47,6 @@ namespace zmq
private
:
private
:
// Peer property IDs.
enum
prop_t
{
prop_type
=
1
,
prop_identity
=
2
};
void
finalise_initialisation
();
void
finalise_initialisation
();
void
dispatch_engine
();
void
dispatch_engine
();
...
...
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