Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
capnproto
Commits
51cb8080
Commit
51cb8080
authored
Apr 02, 2016
by
Oliver Kuckertz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let the OS pick a free port for the test server
parent
49e5e5e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
async-unix-test.c++
c++/src/kj/async-unix-test.c++
+3
-4
No files found.
c++/src/kj/async-unix-test.c++
View file @
51cb8080
...
...
@@ -467,16 +467,15 @@ TEST(AsyncUnixTest, UrgentObserver) {
int
tmpFd
;
char
c
;
// Spawn a TCP server
on localhost:44444
// Spawn a TCP server
KJ_SYSCALL
(
tmpFd
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
));
kj
::
AutoCloseFd
serverFd
(
tmpFd
);
sockaddr_in
saddr
=
{
0
};
saddr
.
sin_family
=
AF_INET
;
saddr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_LOOPBACK
);
saddr
.
sin_port
=
htons
(
44444
);
int
optval
=
1
;
KJ_SYSCALL
(
setsockopt
(
serverFd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
optval
,
sizeof
(
optval
)));
KJ_SYSCALL
(
bind
(
serverFd
,
reinterpret_cast
<
sockaddr
*>
(
&
saddr
),
sizeof
(
saddr
)));
socklen_t
saddrLen
=
sizeof
(
saddr
);
KJ_SYSCALL
(
getsockname
(
serverFd
,
reinterpret_cast
<
sockaddr
*>
(
&
saddr
),
&
saddrLen
));
KJ_SYSCALL
(
listen
(
serverFd
,
1
));
// Accept one connection, send in-band and OOB byte, wait for a quit message
...
...
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