File tree 1 file changed +13
-0
lines changed
src/debug-adapter/connection
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ class ResReqNetSocket extends EventEmitter {
52
52
private lastError : string ;
53
53
private callbacks : Callbacks ;
54
54
private isRunning : boolean ;
55
+ private isMessageFlushLoopStarted = false ;
56
+ private hasNewDataMessage = false ;
55
57
56
58
public attach ( port : number , url : string , timeout : number = 10000 ) {
57
59
var that = this ;
@@ -183,6 +185,17 @@ class ResReqNetSocket extends EventEmitter {
183
185
if ( this . connected ) {
184
186
Logger . log ( 'To target: ' + data ) ;
185
187
this . conn . write ( 'Content-Length: ' + data . length + '\r\n\r\n' + data ) ;
188
+ this . hasNewDataMessage = true ;
189
+ if ( ! this . isMessageFlushLoopStarted ) {
190
+ this . isMessageFlushLoopStarted = true ;
191
+ setInterval ( ( ) => {
192
+ if ( this . hasNewDataMessage ) {
193
+ let msg = 'FLUSH BUFFERS' ;
194
+ this . conn . write ( 'Content-Length: ' + msg . length + '\r\n\r\n' + msg ) ;
195
+ this . hasNewDataMessage = false ;
196
+ }
197
+ } , 200 ) ;
198
+ }
186
199
}
187
200
}
188
201
You can’t perform that action at this time.
0 commit comments