C Socket, verifying server -


how 1 check if no connection possible (that is, server down...) c sockets? in other words; client tries establish contact

connect(sock, (struct sockaddr *)&serveraddr, sizeof serveraddr), server isn't responding. client should hold of variable verify server status, without using read / write?

connect(3) return -1 on error, , set errno appropriate error.

one case may have handle manually timeout. that, can either use multiple threads (a second thread kills socket if it's not connected after timeout expires), or use non-blocking sockets + poll(2). should rare.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -