mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-25 20:26:38 +00:00
delete duplex when connection is closed
This commit is contained in:
parent
eff960bb7f
commit
9b58c9d0c8
@ -121,11 +121,13 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
|||||||
this.duplex = client.monitor();
|
this.duplex = client.monitor();
|
||||||
this.duplex
|
this.duplex
|
||||||
.on('close', () => {
|
.on('close', () => {
|
||||||
|
this.duplex = null;
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
`monitor to ${this.port?.address} using ${this.port?.protocol} closed by client`
|
`monitor to ${this.port?.address} using ${this.port?.protocol} closed by client`
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.on('end', () => {
|
.on('end', () => {
|
||||||
|
this.duplex = null;
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
`monitor to ${this.port?.address} using ${this.port?.protocol} closed by server`
|
`monitor to ${this.port?.address} using ${this.port?.protocol} closed by server`
|
||||||
);
|
);
|
||||||
@ -218,7 +220,6 @@ export class MonitorService extends CoreClientAware implements Disposable {
|
|||||||
// It's enough to close the connection with the client
|
// It's enough to close the connection with the client
|
||||||
// to stop the monitor process
|
// to stop the monitor process
|
||||||
this.duplex.end();
|
this.duplex.end();
|
||||||
this.duplex = null;
|
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
`stopped monitor to ${this.port?.address} using ${this.port?.protocol}`
|
`stopped monitor to ${this.port?.address} using ${this.port?.protocol}`
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user