Thank you Dian. I receieved a compile error when I used the suggested code, so there may be a header file that I am missing. Here are the ones I am using.
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <unistd.h>...
I am calling a web service using a socket call. I want to prevent my client app from 'hanging' until the socket call times out if the service is not running. The app is working fine if the service is running.
//Create the Socket
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.