File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -225,4 +225,12 @@ class InnerCloudTransport extends EventEmitter implements Transport {
225225 }
226226 return this
227227 }
228+
229+ destroy ( error ?: Error ) : this {
230+ if ( this . _open ) {
231+ this . _open = false
232+ this . emit ( 'close' )
233+ }
234+ return this
235+ }
228236}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export interface Transport {
1818 on ( event : 'close' , listener : ( ) => void ) : this
1919 write ( buffer : Uint8Array | string , cb ?: ( err ?: Error ) => void ) : boolean
2020 end ( callback ?: ( ) => void ) : this
21+ destroy ( error ?: Error ) : this
2122}
2223
2324export declare interface DbgpConnection {
@@ -145,7 +146,7 @@ export class DbgpConnection extends EventEmitter {
145146
146147 /** closes the underlying socket */
147148 public close ( ) : Promise < void > {
148- this . _socket . end ( )
149+ this . _socket . destroy ( )
149150 return this . _closePromise
150151 }
151152}
You can’t perform that action at this time.
0 commit comments