File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,8 +201,9 @@ def process(self):
201201 try :
202202 while 1 :
203203 try :
204- # Send 5 UDP packets at a time, to avoid
205- for i in range (5 ):
204+ # Send 30 UDP packets at a time, to avoid
205+ # Node's receive buffer from overflowing
206+ for i in range (30 ):
206207 self ._socket .sendto (
207208 self ._send_buffer .pop (0 ), self ._client_addr )
208209 except :
Original file line number Diff line number Diff line change @@ -251,7 +251,12 @@ export class Ableton extends EventEmitter<EventMap> {
251251
252252 // The recvBufferSize is set to macOS' default value, so the
253253 // socket behaves the same on Windows and doesn't drop any packets
254- this . client = dgram . createSocket ( { type : "udp4" , recvBufferSize : 786896 } ) ;
254+ this . client = dgram . createSocket ( {
255+ type : "udp4" ,
256+ // 4 MB receive buffer to avoid losing packets
257+ recvBufferSize : 4 * 1024 * 1024 ,
258+ } ) ;
259+
255260 this . client . addListener ( "message" , this . handleIncoming . bind ( this ) ) ;
256261
257262 this . client . addListener ( "listening" , async ( ) => {
@@ -305,6 +310,8 @@ export class Ableton extends EventEmitter<EventMap> {
305310 } ) ;
306311 } ) ;
307312
313+ this . logger ?. debug ( "Receive Buffer Size:" , this . client . getRecvBufferSize ( ) ) ;
314+
308315 // Send used port to Live in case the plugin is already started
309316 if ( ! sentPort ) {
310317 try {
You can’t perform that action at this time.
0 commit comments