@@ -78,7 +78,7 @@ export class Channel extends EnhancedEventEmitter {
78
78
} else {
79
79
this . #recvBuffer = Buffer . concat (
80
80
[ this . #recvBuffer, buffer ] ,
81
- this . #recvBuffer. length + buffer . length ,
81
+ this . #recvBuffer. length + buffer . length
82
82
) ;
83
83
}
84
84
@@ -104,7 +104,7 @@ export class Channel extends EnhancedEventEmitter {
104
104
105
105
const dataView = new DataView (
106
106
this . #recvBuffer. buffer ,
107
- this . #recvBuffer. byteOffset + msgStart ,
107
+ this . #recvBuffer. byteOffset + msgStart
108
108
) ;
109
109
const msgLen = dataView . getUint32 ( 0 , IS_LITTLE_ENDIAN ) ;
110
110
@@ -115,7 +115,7 @@ export class Channel extends EnhancedEventEmitter {
115
115
116
116
const payload = this . #recvBuffer. subarray (
117
117
msgStart + 4 ,
118
- msgStart + 4 + msgLen ,
118
+ msgStart + 4 + msgLen
119
119
) ;
120
120
121
121
msgStart += 4 + msgLen ;
@@ -160,14 +160,14 @@ export class Channel extends EnhancedEventEmitter {
160
160
console . warn (
161
161
`worker[pid:${ pid } ] unexpected data: ${ payload . toString (
162
162
'utf8' ,
163
- 1 ,
164
- ) } `,
163
+ 1
164
+ ) } `
165
165
) ;
166
166
}
167
167
}
168
168
} catch ( error ) {
169
169
logger . error (
170
- `received invalid message from the worker process: ${ error } ` ,
170
+ `received invalid message from the worker process: ${ error } `
171
171
) ;
172
172
}
173
173
}
@@ -178,19 +178,19 @@ export class Channel extends EnhancedEventEmitter {
178
178
} ) ;
179
179
180
180
this . #consumerSocket. on ( 'end' , ( ) =>
181
- logger . debug ( 'Consumer Channel ended by the worker process' ) ,
181
+ logger . debug ( 'Consumer Channel ended by the worker process' )
182
182
) ;
183
183
184
184
this . #consumerSocket. on ( 'error' , error =>
185
- logger . error ( `Consumer Channel error: ${ error } ` ) ,
185
+ logger . error ( `Consumer Channel error: ${ error } ` )
186
186
) ;
187
187
188
188
this . #producerSocket. on ( 'end' , ( ) =>
189
- logger . debug ( 'Producer Channel ended by the worker process' ) ,
189
+ logger . debug ( 'Producer Channel ended by the worker process' )
190
190
) ;
191
191
192
192
this . #producerSocket. on ( 'error' , error =>
193
- logger . error ( `Producer Channel error: ${ error } ` ) ,
193
+ logger . error ( `Producer Channel error: ${ error } ` )
194
194
) ;
195
195
}
196
196
@@ -244,13 +244,13 @@ export class Channel extends EnhancedEventEmitter {
244
244
event : Event ,
245
245
bodyType ?: NotificationBody ,
246
246
bodyOffset ?: number ,
247
- handlerId ?: string ,
247
+ handlerId ?: string
248
248
) : void {
249
249
logger . debug ( `notify() [event:${ Event [ event ] } ]` ) ;
250
250
251
251
if ( this . #closed) {
252
252
throw new InvalidStateError (
253
- `Channel closed, cannot send notification [event:${ Event [ event ] } ]` ,
253
+ `Channel closed, cannot send notification [event:${ Event [ event ] } ]`
254
254
) ;
255
255
}
256
256
@@ -264,22 +264,22 @@ export class Channel extends EnhancedEventEmitter {
264
264
handlerIdOffset ,
265
265
event ,
266
266
bodyType ,
267
- bodyOffset ,
267
+ bodyOffset
268
268
) ;
269
269
} else {
270
270
notificationOffset = Notification . createNotification (
271
271
this . #bufferBuilder,
272
272
handlerIdOffset ,
273
273
event ,
274
274
NotificationBody . NONE ,
275
- 0 ,
275
+ 0
276
276
) ;
277
277
}
278
278
279
279
const messageOffset = Message . createMessage (
280
280
this . #bufferBuilder,
281
281
MessageBody . Notification ,
282
- notificationOffset ,
282
+ notificationOffset
283
283
) ;
284
284
285
285
// Finalizes the buffer and adds a 4 byte prefix with the size of the buffer.
@@ -310,13 +310,13 @@ export class Channel extends EnhancedEventEmitter {
310
310
method : Method ,
311
311
bodyType ?: RequestBody ,
312
312
bodyOffset ?: number ,
313
- handlerId ?: string ,
313
+ handlerId ?: string
314
314
) : Promise < Response > {
315
315
logger . debug ( `request() [method:${ Method [ method ] } ]` ) ;
316
316
317
317
if ( this . #closed) {
318
318
throw new InvalidStateError (
319
- `Channel closed, cannot send request [method:${ Method [ method ] } ]` ,
319
+ `Channel closed, cannot send request [method:${ Method [ method ] } ]`
320
320
) ;
321
321
}
322
322
@@ -335,7 +335,7 @@ export class Channel extends EnhancedEventEmitter {
335
335
method ,
336
336
handlerIdOffset ,
337
337
bodyType ,
338
- bodyOffset ,
338
+ bodyOffset
339
339
) ;
340
340
} else {
341
341
requestOffset = Request . createRequest (
@@ -344,14 +344,14 @@ export class Channel extends EnhancedEventEmitter {
344
344
method ,
345
345
handlerIdOffset ,
346
346
RequestBody . NONE ,
347
- 0 ,
347
+ 0
348
348
) ;
349
349
}
350
350
351
351
const messageOffset = Message . createMessage (
352
352
this . #bufferBuilder,
353
353
MessageBody . Request ,
354
- requestOffset ,
354
+ requestOffset
355
355
) ;
356
356
357
357
// Finalizes the buffer and adds a 4 byte prefix with the size of the buffer.
@@ -392,8 +392,8 @@ export class Channel extends EnhancedEventEmitter {
392
392
close : ( ) => {
393
393
pReject (
394
394
new InvalidStateError (
395
- `Channel closed, pending request aborted [method:${ Method [ method ] } , id:${ id } ]` ,
396
- ) ,
395
+ `Channel closed, pending request aborted [method:${ Method [ method ] } , id:${ id } ]`
396
+ )
397
397
) ;
398
398
} ,
399
399
} ;
@@ -408,7 +408,7 @@ export class Channel extends EnhancedEventEmitter {
408
408
409
409
if ( ! sent ) {
410
410
logger . error (
411
- `received response does not match any sent request [id:${ response . id } ]` ,
411
+ `received response does not match any sent request [id:${ response . id } ]`
412
412
) ;
413
413
414
414
return ;
@@ -422,7 +422,7 @@ export class Channel extends EnhancedEventEmitter {
422
422
logger . warn (
423
423
`request failed [method:${ sent . method } , id:${
424
424
sent . id
425
- } ]: ${ response . reason ( ) } `,
425
+ } ]: ${ response . reason ( ) } `
426
426
) ;
427
427
428
428
switch ( response . error ( ) ! ) {
@@ -438,7 +438,7 @@ export class Channel extends EnhancedEventEmitter {
438
438
}
439
439
} else {
440
440
logger . error (
441
- `received response is not accepted nor rejected [method:${ sent . method } , id:${ sent . id } ]` ,
441
+ `received response is not accepted nor rejected [method:${ sent . method } , id:${ sent . id } ]`
442
442
) ;
443
443
}
444
444
}
@@ -451,7 +451,7 @@ export class Channel extends EnhancedEventEmitter {
451
451
// here.
452
452
// See https://github.com/versatica/mediasoup/issues/510
453
453
setImmediate ( ( ) =>
454
- this . emit ( notification . handlerId ( ) ! , notification . event ( ) , notification ) ,
454
+ this . emit ( notification . handlerId ( ) ! , notification . event ( ) , notification )
455
455
) ;
456
456
}
457
457
0 commit comments