[fix] added the error handling for getsockopt