本文整理汇总了TypeScript中https.Server.setTimeout方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Server.setTimeout方法的具体用法?TypeScript Server.setTimeout怎么用?TypeScript Server.setTimeout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类https.Server
的用法示例。
在下文中一共展示了Server.setTimeout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Buffer
server = new https.Server({
IncomingMessage: MyIncomingMessage,
ServerResponse: MyServerResponse
}, reqListener);
server = https.createServer();
server = https.createServer(reqListener);
server = https.createServer({ IncomingMessage: MyIncomingMessage });
server = https.createServer({ ServerResponse: MyServerResponse }, reqListener);
const timeout: number = server.timeout;
const listening: boolean = server.listening;
const keepAliveTimeout: number = server.keepAliveTimeout;
const maxHeadersCount: number | null = server.maxHeadersCount;
const headersTimeout: number = server.headersTimeout;
server.setTimeout().setTimeout(1000).setTimeout(() => {}).setTimeout(100, () => {});
}
}
////////////////////////////////////////////////////
/// string_decoder tests : https://nodejs.org/api/string_decoder.html
////////////////////////////////////////////////////
{
const StringDecoder = string_decoder.StringDecoder;
const buffer = new Buffer('test');
const decoder1 = new StringDecoder();
const decoder2 = new StringDecoder('utf8');
const part1: string = decoder1.write(new Buffer('test'));
const end1: string = decoder1.end();
const part2: string = decoder2.write(new Buffer('test'));