Add DNS API and update Libasync stub.

This commit is contained in:
Sönke Ludwig 2016-10-14 22:24:31 +02:00
parent c6dec730d8
commit 2518a6c301
3 changed files with 90 additions and 5 deletions

View file

@ -12,6 +12,7 @@ interface EventDriver {
@property EventDriverEvents events();
@property EventDriverSignals signals();
@property EventDriverSockets sockets();
@property EventDriverDNS dns();
@property EventDriverFiles files();
@property EventDriverWatchers watchers();
@ -106,6 +107,12 @@ interface EventDriverSockets {
void releaseRef(SocketFD descriptor);
}
interface EventDriverDNS {
@safe: /*@nogc:*/ nothrow:
DNSLookupID lookupHost(string name, DNSLookupCallback on_lookup_finished);
void cancelLookup(DNSLookupID handle);
}
interface EventDriverFiles {
@safe: /*@nogc:*/ nothrow:
FileFD open(string path, FileOpenMode mode);
@ -202,6 +209,7 @@ alias ConnectCallback = void delegate(StreamSocketFD, ConnectStatus);
alias AcceptCallback = void delegate(StreamListenSocketFD, StreamSocketFD);
alias IOCallback = void delegate(StreamSocketFD, IOStatus, size_t);
alias DatagramIOCallback = void delegate(DatagramSocketFD, IOStatus, size_t, scope Address);
alias DNSLookupCallback = void delegate(DNSLookupID, scope Address[] results);
alias FileIOCallback = void delegate(FileFD, IOStatus, size_t);
alias EventCallback = void delegate(EventID);
alias SignalCallback = void delegate(int);
@ -315,3 +323,4 @@ alias EventID = Handle!("Event", FD);
alias TimerID = Handle!("Timer", int);
alias WatcherID = Handle!("Watcher", int);
alias EventWaitID = Handle!("EventWait", int);
alias DNSLookupID = Handle!("DNS", int);