question

Upvotes
Accepted
301 6 17 27

A question about the old socket when RSSL_IP_FD_CHANGE is encountered

I am a newer using UPA API to construct my app. And I have a quick question about the old socket under some situation where the RSSL_IP_FD_CHANGE is returned E.g. rsslInitChannel My key question is: do I need cleaup the old socket after the unregistration IO of it? For example, should I explicitly close it or release it? at least in the documentation I didn’t see the cleanup. So UPA API has done it for me and only thing I should do is unregistering the IO notification bound? My additional question (if possible) is : what if I don’t unregister the IO for old socket, is it harmful?

elektronelektron-sdkrrteta-apielektron-transport-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
401 15 18 33
This socket is automatically cleaned up by the UPA API. You do not have to close it. It is harmful, because the system may reclaim the old file descriptor after it is closed, so it may get triggered if, for example, your application makes another connection and that FD is assigned to the new connection. So the old socket FD should be removed from your notifier when a FD_CHANGE event is received.
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea