Samuel Tesla (stesla) wrote in lj_dev,
Samuel Tesla
stesla
lj_dev

Something weird with the network connection?

I'm encountering something rather strange...and I imagine it has to do with the LJ webservers. A while back, in an effort to learn basic network programming (in C), I wrote a little utility that'd get a single webpage and print it to stdout. I tried it on twenty URLs that I go to all the time "http://www.livejournal.com" among them, and it worked like a charm.

I basically do all the stuff to open a socket, then do this:


/* SNIP resolving address and opening a socket to sockfd */
socketf = fdopen(sockfd, "r+");
fprintf(socketf, "GET http://%s/%s\n\n", domain, path);
while ( (inChar = fgetc(socketf)) != EOF ) {
putchar(inChar);
}


Now, when I try and go add the network stuff to my client's code, it acts weird...I figure, "Hey! Let's go use the htmlgetter again, see if it works." It doesn't. It just sits there for about 5 minutes, and then exits quietly. The code is ripe with error checking. It, does, in fact work for all of the non LJ URL's I've tried (a few on my server, google, etc). Any suggestions?
Subscribe

  • SessionGenerate and ljloggedin

    Are there any information after release 86 and changes in cookies scheme to use sessiongenerate? It returns ljsession key, but this key is not enough…

  • Retrieving comments

    Hi, Is there a way to retrieve a list of comments made by user XXX (which may or may be not the currently logged in user) in the journals of users…

  • Community posts and comments

    Hi! How can I download a community posts with comments when 1) I'm the community moderator 2) I'm not the community moderator ? Thank you

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 5 comments