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
d2b69850
Unverified
Commit
d2b69850
authored
Nov 13, 2017
by
Jim Klimov
Committed by
GitHub
Nov 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2833 from bluca/stream_test_parallel
Problem: test_stream_exceeds_buffer cannot be ran in parallel
parents
cffc1c4d
498c6bbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
test_stream_exceeds_buffer.cpp
tests/test_stream_exceeds_buffer.cpp
+13
-1
No files found.
tests/test_stream_exceeds_buffer.cpp
View file @
d2b69850
...
...
@@ -41,6 +41,7 @@ int main()
const
int
msgsize
=
8193
;
char
sndbuf
[
msgsize
]
=
"
\xde\xad\xbe\xef
"
;
unsigned
char
rcvbuf
[
msgsize
];
char
my_endpoint
[
MAX_SOCKET_STRING
];
int
server_sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
assert
(
server_sock
!=-
1
);
...
...
@@ -52,18 +53,29 @@ int main()
memset
(
&
saddr
,
0
,
sizeof
(
saddr
));
saddr
.
sin_family
=
AF_INET
;
saddr
.
sin_addr
.
s_addr
=
INADDR_ANY
;
#if !defined (_WIN32_WINNT) || (_WIN32_WINNT >= 0x0600)
saddr
.
sin_port
=
0
;
#else
saddr
.
sin_port
=
htons
(
12345
);
#endif
rc
=
bind
(
server_sock
,
(
struct
sockaddr
*
)
&
saddr
,
sizeof
(
saddr
));
assert
(
rc
!=-
1
);
rc
=
listen
(
server_sock
,
1
);
assert
(
rc
!=-
1
);
#if !defined (_WIN32_WINNT) || (_WIN32_WINNT >= 0x0600)
socklen_t
saddr_len
=
sizeof
(
saddr
);
rc
=
getsockname
(
server_sock
,
(
struct
sockaddr
*
)
&
saddr
,
&
saddr_len
);
assert
(
rc
!=
-
1
);
#endif
sprintf
(
my_endpoint
,
"tcp://127.0.0.1:%d"
,
ntohs
(
saddr
.
sin_port
));
void
*
zctx
=
zmq_ctx_new
();
assert
(
zctx
);
void
*
zsock
=
zmq_socket
(
zctx
,
ZMQ_STREAM
);
assert
(
zsock
);
rc
=
zmq_connect
(
zsock
,
"tcp://127.0.0.1:12345"
);
rc
=
zmq_connect
(
zsock
,
my_endpoint
);
assert
(
rc
!=-
1
);
int
client_sock
=
accept
(
server_sock
,
NULL
,
NULL
);
...
...
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