Quantcast
Channel: Embedded Software (Read Only)
Viewing all articles
Browse latest Browse all 25965

Forum Post: RE: NDK: Socket is live or not

$
0
0
Hi Steven, My earlier code used to check for getpeername() before connect() was called & it always ended up struct sin1 not being populated. Now I am using getpeername() after connect() & its working. If the IP address have not being assigned then connect() is returning value less than 1 and I am exiting any further statement containing send() or recv(). As of now, I am okay with the solution. The trick is getpeername() will not work before connect() is called (at least once), although in such a case getpeername() will still return zero indicating that the function is successfully running. - Thanks - Regards Soumyajit Das

Viewing all articles
Browse latest Browse all 25965

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>