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
5fa2ac1d
Commit
5fa2ac1d
authored
Dec 01, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OSX will actually use a 1-byte socket buffer, apparently. Better use a bigger number...
parent
324b4d0f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
serialize-async-test.c++
c++/src/capnp/serialize-async-test.c++
+14
-6
mega-test-quick.cfg
mega-test-quick.cfg
+5
-5
No files found.
c++/src/capnp/serialize-async-test.c++
View file @
5fa2ac1d
...
...
@@ -98,12 +98,20 @@ protected:
// Note: OSX reports ENOTCONN if we also try to shutdown(fds[1], SHUT_RD).
// Request that the buffer size be as small as possible, to force the event loop to kick in.
// The kernel will round this up. We use 1 instead of 0 because OSX reports EINVAL for 0 and
// Cygwin will apparently actually use a buffer size of 0 and therefore blocks forever waiting
// for buffer space.
uint
one
=
1
;
KJ_SYSCALL
(
setsockopt
(
fds
[
0
],
SOL_SOCKET
,
SO_RCVBUF
,
&
one
,
sizeof
(
one
)));
KJ_SYSCALL
(
setsockopt
(
fds
[
1
],
SOL_SOCKET
,
SO_SNDBUF
,
&
one
,
sizeof
(
one
)));
// FUN STUFF:
// - On Linux, the kernel rounds up to the smallest size it permits, so we can ask for a size of
// zero.
// - On OSX, the kernel reports EINVAL on zero, but will dutifully use a 1-byte buffer if we
// set the size to 1. This tends to cause stack overflows due to ridiculously long promise
// chains.
// - Cygwin will apparently actually use a buffer size of 0 and therefore block forever waiting
// for buffer space.
//
// Anyway, we now use 127 to avoid these issues (but also to screw around with non-word-boundary
// writes).
uint
small
=
127
;
KJ_SYSCALL
(
setsockopt
(
fds
[
0
],
SOL_SOCKET
,
SO_RCVBUF
,
&
small
,
sizeof
(
small
)));
KJ_SYSCALL
(
setsockopt
(
fds
[
1
],
SOL_SOCKET
,
SO_SNDBUF
,
&
small
,
sizeof
(
small
)));
}
~
SerializeAsyncTest
()
{
close
(
fds
[
0
]);
...
...
mega-test-quick.cfg
View file @
5fa2ac1d
linux-gcc-4.7 17
57
./super-test.sh tmpdir capnp-gcc-4.7 quick
linux-gcc-4.8 17
60
./super-test.sh tmpdir capnp-gcc-4.8 quick gcc-4.8
linux-clang 17
80
./super-test.sh tmpdir capnp-clang quick clang
mac 80
5
./super-test.sh remote beat caffeinate quick
cygwin 8
10
./super-test.sh remote Kenton@flashman quick
linux-gcc-4.7 17
48
./super-test.sh tmpdir capnp-gcc-4.7 quick
linux-gcc-4.8 17
51
./super-test.sh tmpdir capnp-gcc-4.8 quick gcc-4.8
linux-clang 17
71
./super-test.sh tmpdir capnp-clang quick clang
mac 80
0
./super-test.sh remote beat caffeinate quick
cygwin 8
05
./super-test.sh remote Kenton@flashman quick
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