W3C home > Mailing lists > Public > www-lib@w3.org > July to September 1998

Connection time-out when running libapp_4 example (follows).

From: François VILMAIN <vilmain@cegelec-red.fr>
Date: Wed, 5 Aug 1998 11:43:58 +0200
Message-ID: <01BDC066.58BC3B10@DT3P1744>
To: "'WWWlib'" <www-lib@w3.org>
Hi.

First, thanks for your rapid reply.

In fact, my real problem is to create the connection with "www.w3.org".

In order to investigate this problem, I wrote a little application that reproduces
part of the job that is carried out by libwww :

struct sockaddr_in	server;
 SOCKET		sock;
struct hostent		*h;

/* Create a stream socket */
sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
 
/* Look up the server in the hosts file or wherever (obtained IP address is 18.23.0.22) */
 h = gethostbyname("www.w3.org");

/* Build server's address for connecting */
server.sin_family      = PF_INET;
memcpy(&server.sin_addr, h->h_addr, h->h_length); 
server.sin_port        = htons(80);

 /* Connect to server  */
 if (connect(sock, (struct sockaddr *)&server, sizeof server) == SOCKET_ERROR)
{
...
// The report returned by the connect service is "Attempt to connect timed out without establishing a connection".
}

Any suggestions ?

Thanks.
Received on Wednesday, 5 August 1998 05:43:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:28 GMT