/// import messages = require('./messages'); import net = require('../net/net.types'); /** * Handles relay sockets for the TURN server frontend. */ export declare class Backend { /** * All clients currently known to the server, indexed by tag. * Note that this map is essentially the (extremely inaccurately) named * "5-tuple" introduced in section 2.2 of the TURN RFC: * http://tools.ietf.org/html/rfc5766#section-2.2 */ private allocations_; /** Invoked when a message must be sent to the frontend. */ private ipcHandler_; handleIpc: (stunMessage: messages.StunMessage, clientEndpoint: net.Endpoint) => Promise; /** Promises to allocate a socket, wrapped in an Allocation. */ private makeAllocation_; /** Sets the function to call to send a message to the frontend. */ setIpcHandler: (ipcHandler: (stunMessage: messages.StunMessage, clientEndpoint: net.Endpoint) => void) => void; /** * Copies a Uint8Array into a new ArrayBuffer. Useful when the array * has been constructed from a subarray of the buffer, in which case * bytes.buffer is a much larger array than you are expecting. * TODO: be smarter about using slice in these instances */ private static bytesToArrayBuffer_; private static getRandomTransactionId_; }