Opened udpport is not closed properly

Hello,
I am using the new (2020b) Instrument Control Toolbox's UDP interface : I use the udpport function to construct an udpport object that i set as a object property (that i call oMyClass.oPort) from a Class (MyClass) i've written myself. But sometimes when my oMyClass object is not deleted properly, I think that the udpport oPort object is not either ; because when i run '!netstat -a -n -p UDP', as described here, I see that the port number I used to open my udpport (an only for this one, I checked before opening the connection that it was not used by anything else) is still opened, even if my object, and thus its udpport property, have completely dissapeared from my workspace.
I met the same issue with timers (another property of MyClass is a timer) : If the object that keeps an handle to the timer as a property is deleted, the timer is still running but i have no to acces the timer. But for timer I can use delete(timerfindall) to clear every timer for my session.
I have two questions:
  • Is there a way to list every udp connection opened by a Matlab session, like timerfindall for timers ?
  • What is the best practice to prevent this kind of situaiton when using timers or udpport as properties of other objetcs ? I've tried writting a deticated delete funciton for my class, where I call each object's own delete function, but it does not work.
Thanks for your help.

Answers (0)

Categories

Products

Release

R2022a

Asked:

on 15 May 2023

Edited:

on 15 May 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!