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
6c382c5c
Commit
6c382c5c
authored
Jun 12, 2012
by
Ian Barber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix whitespace in test"
This reverts commit
0b3478d6
.
parent
72bae207
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
test_connect_delay.cpp
tests/test_connect_delay.cpp
+19
-19
No files found.
tests/test_connect_delay.cpp
View file @
6c382c5c
...
...
@@ -39,7 +39,7 @@ int main (int argc, char *argv [])
assert
(
context
);
void
*
to
=
zmq_socket
(
context
,
ZMQ_PULL
);
assert
(
to
);
val
=
0
;
rc
=
zmq_setsockopt
(
to
,
ZMQ_LINGER
,
&
val
,
sizeof
(
val
));
assert
(
rc
==
0
);
...
...
@@ -49,7 +49,7 @@ int main (int argc, char *argv [])
// Create a socket pushing to two endpoints - only 1 message should arrive.
void
*
from
=
zmq_socket
(
context
,
ZMQ_PUSH
);
assert
(
from
);
val
=
0
;
zmq_setsockopt
(
from
,
ZMQ_LINGER
,
&
val
,
sizeof
(
val
));
rc
=
zmq_connect
(
from
,
"tcp://localhost:5556"
);
...
...
@@ -64,7 +64,7 @@ int main (int argc, char *argv [])
rc
=
zmq_send
(
from
,
message
.
data
(),
message
.
size
(),
0
);
assert
(
rc
>=
0
);
}
sleep
(
1
);
seen
=
0
;
for
(
int
i
=
0
;
i
<
10
;
++
i
)
...
...
@@ -76,43 +76,43 @@ int main (int argc, char *argv [])
seen
++
;
}
assert
(
seen
==
5
);
rc
=
zmq_close
(
from
);
assert
(
rc
==
0
);
rc
=
zmq_close
(
to
);
assert
(
rc
==
0
);
rc
=
zmq_ctx_destroy
(
context
);
assert
(
rc
==
0
);
context
=
zmq_ctx_new
();
fprintf
(
stderr
,
" Rerunning with DELAY_ATTACH_ON_CONNECT
\n
"
)
;
std
::
cout
<<
" Rerunning with DELAY_ATTACH_ON_CONNECT
\n
"
;
to
=
zmq_socket
(
context
,
ZMQ_PULL
);
assert
(
to
);
rc
=
zmq_bind
(
to
,
"tcp://*:5560"
);
assert
(
rc
==
0
);
assert
(
rc
==
0
);
val
=
0
;
rc
=
zmq_setsockopt
(
to
,
ZMQ_LINGER
,
&
val
,
sizeof
(
val
));
assert
(
rc
==
0
);
// Create a socket pushing to two endpoints - all messages should arrive.
from
=
zmq_socket
(
context
,
ZMQ_PUSH
);
assert
(
from
);
val
=
0
;
rc
=
zmq_setsockopt
(
from
,
ZMQ_LINGER
,
&
val
,
sizeof
(
val
));
assert
(
rc
==
0
);
val
=
1
;
rc
=
zmq_setsockopt
(
from
,
ZMQ_DELAY_ATTACH_ON_CONNECT
,
&
val
,
sizeof
(
val
));
assert
(
rc
==
0
);
rc
=
zmq_connect
(
from
,
"tcp://localhost:5561"
);
assert
(
rc
==
0
);
rc
=
zmq_connect
(
from
,
"tcp://localhost:5560"
);
assert
(
rc
==
0
);
...
...
@@ -123,9 +123,9 @@ int main (int argc, char *argv [])
rc
=
zmq_send
(
from
,
message
.
data
(),
message
.
size
(),
0
);
assert
(
rc
>=
0
);
}
sleep
(
1
);
seen
=
0
;
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
...
...
@@ -136,7 +136,7 @@ int main (int argc, char *argv [])
rc
=
zmq_close
(
from
);
assert
(
rc
==
0
);
rc
=
zmq_close
(
to
);
assert
(
rc
==
0
);
...
...
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