Sönke Ludwig
c404cc2e5b
Merge pull request #76 from Boris-Barboris/keepalive_params
...
fix Keepalive on Linux, expose keepalive options, TCP_USER_TIMEOUT for linux.
2018-08-29 23:16:23 +02:00
Boris-Barboris
ed9fdcd467
ease asserting, constants wrapped for future robustness
2018-06-06 11:45:36 +00:00
Boris-Barboris
322438697c
TCP_USER_TIMEOUT
2018-04-02 14:02:09 +00:00
Boris-Barboris
cdb141ba4a
add setKeepAliveParams method
2018-04-02 11:11:28 +00:00
Hiroki Noda
e68f1425a9
format
2018-03-22 05:16:36 +09:00
Hiroki Noda
d3708c5e66
Fix: leak fd
2018-03-22 05:14:10 +09:00
Hiroki Noda
041d55e584
Get the listen backlog size from net.core.somaxconn on linux
2018-03-22 05:12:37 +09:00
Sönke Ludwig
7da41301af
Tighten the file descriptor slot checks.
...
Gives the chance to detect possible dangling file descriptors earlier.
2018-03-17 13:11:44 +01:00
Sönke Ludwig
7bfbb64899
Add userData!T properties for all descriptor based primitives.
2018-03-16 13:39:03 +01:00
Sönke Ludwig
02de8341aa
Call the callback on connectStream socket creation failure.
...
The callback must *always* be called at some point, because the generic async->sync logic in vibe-core otherwise has no way to know whether to expect a callback or not.
2018-03-14 20:43:40 +01:00
Sönke Ludwig
df78af96bb
Use a custom nogc_assert in cleanup code.
...
Unfortunately the built-in assert GC allocates an exception, which means that if called directly or indirectly form a finalizer, the assertion will not become visible and instead an InvalidMemoryOperationError is thrown.
This implements a custom nogc_assert() function that directly prints the assertion message and uses abort() to end the process.
2018-03-11 13:56:10 +01:00
Sönke Ludwig
b2b072dd80
Reduce the number of ChoppedVector index operations.
2018-02-22 01:58:49 +01:00
Diederik de Groot
41312a589e
Remove static compiler __VERSION check. "import core.sys.dragonflybsd.netinet.in_" will work, when compiler support is there.
...
[See](https://github.com/vibe-d/vibe.d/pull/2028#discussion_r161077152 )
2018-01-11 10:40:37 +01:00
Diederik de Groot
e062e44f1c
Fix compilation on DragonFlyBSD
2018-01-09 15:23:23 +01:00
Sönke Ludwig
6e2938297b
Set O_CLOEXEC on the remaining FDs that are created by eventcore.
2017-12-19 22:10:14 +01:00
Sönke Ludwig
8528b4ec00
Fix accidental resetting of O_NONBLOCK and set O_CLOEXEC on outgoing sockets, too.
2017-12-18 14:07:38 +01:00
Hiroki Noda
1179163150
Add O_CLOEXEC for some posix platform
2017-12-18 09:44:08 +01:00
Hiroki Noda
b252c97012
Set close-on-exec flag to prevent fd leakage for command execution
2017-12-18 09:44:08 +01:00
Sönke Ludwig
a5d4cf875c
Add adoptDatagramSocketInternal.
2017-11-25 00:26:44 +01:00
Sönke Ludwig
31286e4580
Ensure the socket handle passed to callbacks is always valid on Posix.
2017-11-23 23:12:35 +01:00
Boris-Barboris
36b0413d32
remove cabblack invocation
2017-11-11 15:44:13 +00:00
Boris-Barboris
0cac9d56e0
cancelConnectStream for Posix
2017-11-11 01:14:54 +00:00
Sönke Ludwig
a52d064c9e
Add multicast constant definitions for Solaris.
2017-09-26 15:45:51 +02:00
Sönke Ludwig
28e1a83057
Add an interface_index argument to joinMulticastGroup.
2017-09-11 13:35:34 +02:00
Sönke Ludwig
06c6e0a4ca
Add basic UDP multicast support.
...
This also adds a new setOption method to handle boolean socket options in a generic way.
2017-09-03 18:14:57 +02:00
Sönke Ludwig
07baa0f612
Improve performance of accepting incoming connections.
...
- Removes the accept() loop, as that doesn't measurably improve performance in practice. This also gives each connection the possibility to perform initial I/O before more concurrency is generated by accepting the next connection.
- Uses SOCK_NONBLOCK in conjunction with socket() and accept4() to save one additional syscall per connection.
2017-09-02 15:40:07 +02:00
Sönke Ludwig
fc5df2f949
Use level-triggered events for listening stream sockets.
...
The limit of 20 accepted connections per event invocation can otherwise lead to no more connections being accepted when more that 20 connections are available at a time. This is an adaptation of @Boris-Barboris pull request #21 to restrict the level triggered behavior to listening sockets. See also #20 .
2017-09-02 00:12:58 +02:00
Sönke Ludwig
1c666a0191
Fix send() return value handling.
...
A value of 0 doesn't indicate a closed connection as for recv().
2017-07-19 10:42:33 +02:00
Sönke Ludwig
9518ec4dce
Remove log noise for listening TCP sockets.
2017-07-14 12:35:17 +02:00
Sönke Ludwig
ab796477e2
Move .userData to the socket driver.
...
Generally each FD type should have its own .userData property in the respective driver. This is important for drivers that don't have a unified file descriptor space and need to store user data in a type specific way.
2017-06-24 22:01:32 +02:00
Sönke Ludwig
d99eb1be34
Fix waiter count tracking in the Posix driver. Fixes #8 .
2017-06-10 10:27:55 +02:00
Sönke Ludwig
872f1b12b9
For direction of getLocalAddress and getRemoteAddress.
2017-03-24 09:04:32 +01:00
Sönke Ludwig
1d330d6330
Extend datagram socket API.
...
Adds .setTargetAddress() and makes .getXAddress() work for datagram sockets, too.
2017-03-10 22:46:43 +01:00
Sönke Ludwig
2e5b13ee98
Add EventDriverSockets.getRemoteAddress.
2017-03-10 20:25:28 +01:00
Sönke Ludwig
49521f2586
Remove debug output.
2017-01-31 10:06:51 +01:00
Sönke Ludwig
4b357c3326
Make sure the socket ref count can reach zero in user code.
2017-01-30 23:11:09 +01:00
Sönke Ludwig
490dc15128
Properly handle the case where a TCP connection gets immediately disconnected.
...
This can result in both, the write-ready and the disconnect events, to be triggered during the same event loop iteration.
2017-01-30 22:52:13 +01:00
Sönke Ludwig
773e09cd3d
Fix (immediate) detection of remove connection close for EPOLL.
2017-01-30 21:01:31 +01:00
Sönke Ludwig
956978cc79
Fix out of order processing issue with the TCP connection callback.
...
It could happen that the socket FD got reused before the connection callback was cleared. This in turn could result in the new connection callback to get overwritten with null.
2017-01-30 10:54:43 +01:00
Sönke Ludwig
4703f021ec
Fix setting initial state for incoming TCP connections.
2017-01-29 21:00:27 +01:00
Sönke Ludwig
3d81854214
Add StreamListenOptions.
...
Can be used to set the SO_REUSEPORT option for multi-thread/multi-process incoming TCP connection distribution.
2017-01-27 22:09:05 +01:00
Sönke Ludwig
87394165de
Only bind outgoing stream sockets explicitly if requested.
2017-01-25 12:57:02 +01:00
Sönke Ludwig
d1829669ec
Split up Posix event driver into separate files.
2017-01-25 00:11:57 +01:00