Stopping EventStream (stream.abort())

Continuing the discussion from Lost event stream [solved]:

@Dave,

I tried stream.abort() to abort event stream as follows. None works.

particle.getEventStream({ deviceId: Device_Id, auth: UserAccess_Token }).then(function(stream) {
    stream.abort();
   
  }); 

or

particle.getEventStream({ deviceId: Device_Id, auth: UserAccess_Token }).then(function(stream) {
   
    stream.on('abort', function(data) {
      console.log("P Abort Device Event: " + data);
      cb(null,data);

    });
    
  });

None of the above option works. Please let me know what I am missing.

Thanks.

A post was merged into an existing topic: Lost event stream [solved]