Showing results for 
Search instead for 
Did you mean: 

How to check if CNSEndpoint exists?

Hi! How can I check whether my Network Stream endpoint "exists" or not? I'm running into problems when I try using CNSFlush after losing my connection and get error messages like "The endpoint doesn't exist" or "You're passing NULL pointers to the CNS Library". I have tried some things, but none have worked so far.


// endpoint is of type CNSEndpoint

if (endpoint) //Doesn't work

if (endpoint != NULL) //Doesn't work

int test = 0;
CNSGetEndpointAttribute(endpoint, CNSAttributeIsEndpointConnected, &test);
//Crashes and burns because "A NULL pointer was passed to the Network Streams Library".

The endpoint seems to contain some value (for instance 3145729), maybe an address or an ID? This is probably why just checking if it itself is NULL doesn't work. Any ideas?



0 Kudos
Message 1 of 1