/// /// import net = require('./net.types'); /** * Represents a UDP socket. * TODO: this is so similar to udprelay.ts that they can almost certainly * be merged into one */ declare class UdpClient { private destAddress_; private destPort_; private onData_; /** * Socket on which we are sending and receiving messages. */ private socket; private address_; private port_; constructor(destAddress_: string, destPort_: number, onData_: (data: ArrayBuffer) => any); /** * Returns a promise to create a socket, bind to the specified address and * port, and start relaying events. Specify port zero to have the system * choose a free port. */ bind(): Promise; private onSocksClientData; /** * Returns a promise to close the socket. */ close: () => any; /** * Returns a promise to send data to the client. * This is intended for relaying responses from remote servers back to * the client. */ send(buffer: ArrayBuffer): Promise; /** * Returns the address on which the local socket associated with this * relay is listening. */ getAddress: () => string; /** * Returns the port on which the local socket associated with this * relay is listening. */ getPort: () => number; } export = UdpClient;