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
↧