commit
d52e065605
|
@ -38,7 +38,7 @@ final class CFRunLoopEventLoop : KqueueEventLoopBase {
|
|||
|
||||
CFFileDescriptorEnableCallBacks(m_kqueueDescriptor, CFOptionFlags.kCFFileDescriptorReadCallBack);
|
||||
m_kqueueSource = CFFileDescriptorCreateRunLoopSource(kCFAllocatorDefault, m_kqueueDescriptor, 0);
|
||||
CFRunLoopAddSource(CFRunLoopGetMain(), m_kqueueSource, kCFRunLoopDefaultMode);
|
||||
CFRunLoopAddSource(CFRunLoopGetCurrent(), m_kqueueSource, kCFRunLoopDefaultMode);
|
||||
}
|
||||
|
||||
override bool doProcessEvents(Duration timeout)
|
||||
|
|
|
@ -851,7 +851,11 @@ final class PosixEventDriverSockets(Loop : PosixEventLoop) : EventDriverSockets
|
|||
}
|
||||
|
||||
scope src_addrc = new RefAddress(() @trusted { return cast(sockaddr*)&src_addr; } (), src_addr_len);
|
||||
on_receive_finish(socket, IOStatus.ok, ret, src_addrc);
|
||||
if (ret == 0) {
|
||||
on_receive_finish(socket, IOStatus.disconnected, 0, src_addrc);
|
||||
} else {
|
||||
on_receive_finish(socket, IOStatus.ok, ret, src_addrc);
|
||||
}
|
||||
}
|
||||
|
||||
package void receiveNoGC(DatagramSocketFD socket, ubyte[] buffer, IOMode mode, void delegate(DatagramSocketFD, IOStatus, size_t, scope RefAddress) @safe nothrow @nogc on_receive_finish)
|
||||
|
|
|
@ -391,7 +391,7 @@ final class FSEventsEventDriverWatchers(Events : EventDriverEvents) : EventDrive
|
|||
|
||||
slot.stream = FSEventStreamCreate(null, &onFSEvent, () @trusted { return &ctx; } (),
|
||||
paths, since_when, 0.1, kFSEventStreamCreateFlagFileEvents|kFSEventStreamCreateFlagNoDefer);
|
||||
FSEventStreamScheduleWithRunLoop(slot.stream, CFRunLoopGetMain(), kCFRunLoopDefaultMode);
|
||||
FSEventStreamScheduleWithRunLoop(slot.stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||
FSEventStreamStart(slot.stream);
|
||||
|
||||
m_streamMap[cast(void*)slot.stream] = slot.id;
|
||||
|
|
|
@ -93,6 +93,7 @@ static if (!is(CFRunLoopRef)) {
|
|||
extern const CFStringRef kCFRunLoopCommonModes;
|
||||
|
||||
CFRunLoopRef CFRunLoopGetMain() @nogc;
|
||||
CFRunLoopRef CFRunLoopGetCurrent() @nogc;
|
||||
void CFRunLoopAddSource(CFRunLoopRef rl, CFRunLoopSourceRef source, CFRunLoopMode mode) @nogc;
|
||||
CFRunLoopRunResult CFRunLoopRunInMode(CFRunLoopMode mode, CFTimeInterval seconds, Boolean returnAfterSourceHandled);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue