File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ SSDP.prototype._start = function (cb) {
254254 } catch ( e ) {
255255 if ( e . code === 'ENODEV' || e . code === 'EADDRNOTAVAIL' ) {
256256 self . _logger ( 'Interface %s is not present to add multicast group membership. Scheduling a retry. Error: %s' , addr , e . message )
257- setTimeout ( addMembership , 5000 )
257+ delay ( ) . then ( addMembership ) . catch ( e => { throw e } )
258258 } else {
259259 throw e
260260 }
@@ -264,6 +264,12 @@ SSDP.prototype._start = function (cb) {
264264 socket . addMembership ( self . _ssdpIp , iface ) // TODO: specifying the interface in there might make a difference
265265 socket . setMulticastTTL ( self . _ssdpTtl )
266266 }
267+
268+ function delay ( ) {
269+ return new Promise ( ( resolve ) => {
270+ setTimeout ( resolve , 5000 ) ;
271+ } ) ;
272+ }
267273 } )
268274
269275 if ( self . _explicitSocketBind ) {
You can’t perform that action at this time.
0 commit comments