hi

I am trying to open a tcp port to a server, did it and it works.

now i blocked the server via firewall.

trying to connect just hangs.

how do i make 'connect' timeout ?

regards
erez.

btw: here is the code:

hen=gethostbyname(host);
if (!hen) {perror("gethostbyaddr");exit(1);}
memset(&sa, 0, sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_port = htons(port);
memcpy(&sa.sin_addr.s_addr, hen->h_addr_list[0], hen->h_length);
sock_fd=socket(AF_INET,SOCK_STREAM,IPPROTO_IP);
if (sock_fd<0) {perror("socket");exit(1);}
if (connect(sock_fd,(struct sockaddr *)&sa,sizeof(sa))<0)
{perror("connect");exit(1);}




=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to