Commit graph

435 commits

Author SHA1 Message Date
Sönke Ludwig 7795195ec1 Fix recursive directory watcher test to check for unexpected events. 2017-11-23 23:11:16 +01:00
Sönke Ludwig e154446a9d Enable directory watcher tests on macOS.
Also fixes some timings to work with the polling watcher implementation.
2017-11-23 23:11:16 +01:00
Sönke Ludwig 19879712e6 Fix shutdown procedure and rename event order for the polling watcher.
Renames should always be reported as removed->added instead of added->removed.
2017-11-23 23:11:16 +01:00
Sönke Ludwig 1d4fbc4fa2 Fixup poll driver. 2017-11-23 23:11:16 +01:00
Sönke Ludwig c8fd340240 Fix destruction of PosixEventDriverEvents event.
The reference count was one too high and the waiter count was not properly decremented when an event got destroyed.
2017-11-23 23:11:16 +01:00
Sönke Ludwig aa9a08f571 Explicitly dispose the event driver on thread shutdown.
Handle multiple calls to dispose() gracefully, because external code may already make an explicit call to dispose().
2017-11-23 23:11:16 +01:00
The Dlang Bot 1cadc3077b
Merge pull request #34 from vibe-d/avoid_dot_in_watcher_path
Avoid "." path in InotifyEventDriverWatchers.
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
2017-11-22 18:28:27 +01:00
Sönke Ludwig 16e95b03e8 Fix WinAPI watcher to be consistent. 2017-11-22 17:14:31 +01:00
Sönke Ludwig a9ae496fb4 Avoid "." path in InotifyEventDriverWatchers.
The vibe-core tests broke because a "/./" path segment slipped into the resulting paths.
2017-11-22 17:07:49 +01:00
l-kramer faf4bbcdc1
Merge pull request #32 from vibe-d/recursive_dirwatch
Improve directory watching
2017-11-21 21:26:39 +01:00
Sönke Ludwig c3d49db8c5 Update README. 2017-11-21 10:42:22 +01:00
Sönke Ludwig 5246593432 Fix handling recursive inotify based directory watchers. 2017-11-21 10:42:21 +01:00
Sönke Ludwig 0ec498207d Gag directory modified events in win32. 2017-11-21 10:42:21 +01:00
Sönke Ludwig 99088e1202 Implement a generic polling based directory watcher.
This is used on platforms that don't have a specialized watcher implementation.
2017-11-21 10:42:21 +01:00
Sönke Ludwig 815db0727c Change all invalid handle values to ~0 and improve FileChange.
FileChange now has the full path of a file split into the base path (as specified when creating the watcher), the sub directory, and the file name. This allows to work with less dynamic memory allocations internally.
2017-11-21 10:42:14 +01:00
Sönke Ludwig 5bba45485c Add recursive directory watcher test. 2017-11-21 08:59:19 +01:00
Sönke Ludwig 3352423414 Fix decrementing the waiter count when destroying a WinAPI event with active waiters. 2017-11-21 00:09:41 +01:00
Sönke Ludwig fdeef38ef4 Fix waiter count tracking for WinAPI directory watchers and avoid empty callbacks. 2017-11-20 15:59:35 +01:00
Sönke Ludwig 314bd2bb48 Fix WinAPI condition for outOfWaiters event loop exit reason.
Calling processEvents could previously block indefinitely even if there were no waiters left.
2017-11-20 15:59:35 +01:00
Sönke Ludwig bcc6614b00
Merge pull request #31 from vibe-d/fix_winapi_watcher_destruction
Fix a possible range error when a win32 file watcher gets destroyed w…
2017-11-17 23:07:59 +01:00
Sönke Ludwig 7cc6bec14a Fix a possible range error when a win32 file watcher gets destroyed while waiting.
This is not a final solution, but avoids the fatal error and replaces it with, at worst, bogus change events being reported.
2017-11-17 18:35:48 +01:00
The Dlang Bot 88bfabf557
Merge pull request #30 from vibe-d/improve_cancel_conn
Improve cancelStreamConnection and implement on Win32
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
2017-11-12 15:02:36 +01:00
Sönke Ludwig 0897b1bc9e Implement WinAPIEventDriverSockets.cancelConnectStream. 2017-11-12 14:41:08 +01:00
Sönke Ludwig 784d4360d5 Add test for cancelConnectStream. 2017-11-12 14:35:17 +01:00
Sönke Ludwig 569b75e050 More detailed documentation for cancelConnectStream(). 2017-11-12 14:34:58 +01:00
The Dlang Bot f146fa01f4
Merge pull request #28 from Boris-Barboris/connect_cancel
cancelConnectStream for Posix
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
2017-11-11 16:57:28 +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
The Dlang Bot 8d7c1e3c96
Merge pull request #27 from vibe-d/fix_threaded_file
Fix ThreadedFileEventDriver read/write issues.
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
2017-10-30 23:51:40 +01:00
Sönke Ludwig c4550f0e59
Fix ThreadedFileEventDriver read/write issues.
I/O errors were being reported as IOStatus.ok instead of IOStatus.error, and the I/O operation finalization protocol had a potential race-condition when storing the number of bytes processed.
2017-10-30 22:54:14 +01:00
The Dlang Bot 5203766044 Merge pull request #26 from vibe-d/issue25-periodic-timers
Fix periodic timers blocking other timers. Fixes #25.
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
2017-09-26 18:24:29 +02:00
Sönke Ludwig 8799b7b01e Add assertion. 2017-09-26 15:49:13 +02:00
Sönke Ludwig 60407b783b Fix re-enqueuing of periodic timers. Fixes #25.
Periodic timers were first re-enqueued and then removed, effectively causing them to stay at their old position, cutting off the tail of the timer queue.
2017-09-26 15:49:13 +02:00
Sönke Ludwig ef7c19d373 Add test for issue #25 - periodic timers overlapping single-shot timers. 2017-09-26 15:49:09 +02:00
Sönke Ludwig a52d064c9e Add multicast constant definitions for Solaris. 2017-09-26 15:45:51 +02:00
Sönke Ludwig fc6c18faad Add missing default parameter. 2017-09-23 15:00:46 +02:00
The Dlang Bot 100bd2c491 Merge pull request #24 from vibe-d/multicast_if
Add an interface_index argument to joinMulticastGroup.
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
2017-09-11 14:11:21 +02:00
Sönke Ludwig 28e1a83057 Add an interface_index argument to joinMulticastGroup. 2017-09-11 13:35:34 +02:00
Sönke Ludwig 8b95e9fb2d Don't allow winapi driver builds to fail. 2017-09-05 15:23:34 +02:00
Sönke Ludwig bada4d701f Fix linker error for LDC/Windows. 2017-09-05 15:09:06 +02:00
The Dlang Bot 28cfef2e2c Merge pull request #22 from vibe-d/udp_multicast
Add basic UDP multicast support.
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
2017-09-03 18:18:11 +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 166ccfe861
Update compiler support list. 2017-09-02 18:11:45 +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 eb595ef858 Fix always calling GC.addRange in ChoppedVector if necessary. 2017-08-26 22:33:00 +02:00
Sönke Ludwig 74352a9ac5 Avoid dangling socket slot access in the WinAPI driver.
When the last reference got released while a blocking socket operation was still in progress, the old slot was still accessed from the completion callback, leading to null pointer accesses or other issues.
2017-08-21 21:02:13 +02:00
Sönke Ludwig 44b43e8415
Fix error message. 2017-08-14 15:14:05 +02:00
Sönke Ludwig a63907b9f7
Fix multiple bugs in ThreadedFileEventDriver.
- Errors were reported as "ok"
- The cancel state logic was flawed and could lose cancel requests
- Operations could be removed from the active sets before they actually finished, causing the callback to never get called
2017-08-14 01:58:42 +02:00
Sönke Ludwig dd873ec6cf
Add example to get(Local/Remove)Address and fix some ddoc syntax errors. 2017-08-12 21:25:27 +02:00