File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,9 @@ export default class Connection extends EventEmitter {
78
78
return this ;
79
79
}
80
80
81
- public write ( data : Buffer , callback ?: ( err ?: Error ) => void ) : boolean {
82
- return this . socket . write ( dump ( data ) , callback ) ;
81
+ public write ( data : Buffer , callback ?: ( err ?: Error ) => void ) : this {
82
+ this . socket . write ( dump ( data ) , callback ) ;
83
+ return this ;
83
84
}
84
85
85
86
public startServer ( ) : Bluebird < ChildProcess > {
Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ export default class Sync extends EventEmitter {
191
191
if ( ! this . connection . socket . writableNeedDrain && ( chunk = stream . read ( DATA_MAX_LENGTH ) || stream . read ( ) ) ) {
192
192
this . _sendCommandWithLength ( Protocol . DATA , chunk . length ) ;
193
193
transfer . push ( chunk . length ) ;
194
- if ( this . connection . write ( chunk , track ) ) {
194
+ if ( ! this . connection . write ( chunk , track ) . socket . writableNeedDrain ) {
195
195
return writeNext ( ) ;
196
196
} else {
197
197
return waitForDrain ( ) . then ( writeNext ) ;
You can’t perform that action at this time.
0 commit comments