- From: Gregory Nicholls <gnicholls@level8.com>
- Date: Thu, 01 Jun 2000 13:32:36 -0400
- To: www-lib@w3.org
Hiya, I've started experimenting with this library to see if I can figure out what's what. I'm trying to use the user's guide rather than the samples so I can get a feel for the exact sequence of operations. I've a program-ette that is supposed to load the default url from my local apache server. The trace shows a hostname resolution error. Now if I build one of the sample 'Get' programs, I can retrieve this document using the same URL. Could some kind soul tell me what I've missed please ?? And on a related note. How do I check for errors after each operation (or am I even supposed to) Thanks, Greg. ----------------- trace snippet ------------------------------------------------------ HTHost 00A32910 going to state TCP_CHANNEL. HTHost 00A32910 going to state TCP_DNS. Error....... Add 73 Severity: 1 Parameter: `WinSock reported error=10093 ' Where: `gethostbyname' HTDoConnect. Can't locate `localhost' Error....... Add 51 Severity: 1 Parameter: `localhost' Where: `HTDoConn ect' ------------------ Code --------------------------------------------------------------- int main (int argc, char ** argv) { HTAnchor *anchor; HTRequest *request; HTResponse *response; HTChunk * chunk = NULL; /* Initialize libwww core */ HTLibInit("gettest","1.0"); HTTransport_add("buffered_tcp",HT_TP_SINGLE, HTReader_new, HTBufferWriter_new); HTProtocol_add("http","buffered_tcp",80, NO, HTLoadHTTP,NULL); /* set up trace */ HTPrint_setCallback(printer); HTTrace_setCallback(tracer); /* Turn on TRACE so we can see what is going on */ HTSetTraceMessageMask("sop"); /* setup a request */ anchor=HTAnchor_findAddress("http://localhost/"); request=HTRequest_new(); HTRequest_setAnchor(request,anchor); response=HTRequest_response(request); HTRequest_setMethod(request,METHOD_GET); HTLoadAnchor(anchor,request); /* Clean up the request */ HTRequest_delete(request); /* Terminate the Library */ HTLibTerminate(); return 0; }
Received on Thursday, 1 June 2000 13:29:54 UTC