'close' 事件
发生以下情况之一时会触发 'close' 事件:
rl.close()方法被调用,InterfaceConstructor实例放弃了对input和output流的控制;input流接收到它的'end'事件;input流接收 Ctrl+D 以发出传输结束(EOT)的信号;input流接收 Ctrl+C 以发出SIGINT信号,并且在InterfaceConstructor实例上没有注册'SIGINT'事件监听器。
调用监听器函数时不传入任何参数。
一旦触发 'close' 事件,则 InterfaceConstructor 实例就完成了。
The 'close' event is emitted when one of the following occur:
- The
rl.close()method is called and theInterfaceConstructorinstance has relinquished control over theinputandoutputstreams; - The
inputstream receives its'end'event; - The
inputstream receives Ctrl+D to signal end-of-transmission (EOT); - The
inputstream receives Ctrl+C to signalSIGINTand there is no'SIGINT'event listener registered on theInterfaceConstructorinstance.
The listener function is called without passing any arguments.
The InterfaceConstructor instance is finished once the 'close' event is
emitted.