Add lookup to dgram SocketOptions (#20636)

This commit is contained in:
Alessandro Vergani
2017-10-17 18:16:06 +02:00
committed by Andy
parent fa63fd564a
commit 52f686b9db
2 changed files with 3 additions and 0 deletions

View File

@@ -2657,6 +2657,7 @@ declare module "net" {
declare module "dgram" {
import * as events from "events";
import * as dns from "dns";
interface RemoteInfo {
address: string;
@@ -2683,6 +2684,7 @@ declare module "dgram" {
reuseAddr?: boolean;
recvBufferSize?: number;
sendBufferSize?: number;
lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void;
}
export function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;

View File

@@ -1375,6 +1375,7 @@ namespace dgram_tests {
});
ds.send(new Buffer("hello"), 5000, "127.0.0.1");
ds.setMulticastInterface("127.0.0.1");
ds = dgram.createSocket({ type: "udp4", reuseAddr: true, recvBufferSize: 1000, sendBufferSize: 1000, lookup: dns.lookup });
}
{