IE end of transmission?

This is a discussion on IE end of transmission? within the C++ Programming forums, part of the General Programming Boards category; More networking issues here. My problem is that when I have the IE browser access my server, it just sits ...

  1. #1
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708

    IE end of transmission?

    More networking issues here. My problem is that when I have the IE browser access my server, it just sits there, waiting for more bytes. Yet, when I use the client I made, all goes well. So it has to do with IE wanting a sort of "end of transmission" from me. Unfortunately, I can't figure what those bytes may be. I know that when I use my client to access an external server, I send "\r\n\r\n" as the standard "done sending" signal. But the server never gives me any signal. Now I'm really confused! Then how does my client know?? I wrote it dammit! What's going on here? Ok, well if someone can help, please do....
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    I get it. IE expects me to close the socket. That's "the signal". OK, but why? Efficiency?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    I *think* IE can keep the socket open, that way it can reuse it.... could be wrong though. There is a http header called something like:
    Connection: Close
    OR
    Connection: keep-alive

    ... maybe worth reading the RFC's to see how they're supposed to be used.

    (I'm assuming you're talking about HTTP here?)
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Well, the header from IE indeed contains the instructions "keep alive", yet the connection has to be closed to "display the page". Anyway, all seems to work just fine, and so for now, I am content.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  5. #5
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    So you're serving a web page, I presume? (just checking!) Do you have to specify the number of bytes in the data (I think its one of the headers, I haven't looked in ages). Are you sending the right number of bytes, and does your data contain </html>
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    The server itself is a multithreaded, generic one that basically writes input to the command line of user-defined program(s), reads the results from temp files created by said program(s), and finally, outputs the results to the client. Thus, hardcoding is avoided and reusability is established.
    As to specifying the bytes, that is a great question, and may be the reason for the contradictory "keep alive - yet hang till socket closes" behaviour. I will research that.

    >>Are you sending the right number of bytes.

    Yes.

    >> and does your data contain </html>

    Yes, the program I wrote to process the request was sending an <html> </html> tagged file.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  7. #7
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    To clarify, I'm talking about content-length (IIRC)
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  8. #8
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Ok, thanks Hammer. Would you believe I haven't even reviewed all of that yet? Depressing. But now that I've gotton most of the mechanics worked out, I will get to work! Heh, funny, I've used a client I wrote for several months without ever having to worry about that, I just strip all of the HTML and go from there. Anyway, thanks for the link
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Modify to make Doubly Linked List
    By Dampecram in forum C Programming
    Replies: 10
    Last Post: 11-03-2008, 07:25 PM
  2. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 02:30 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  4. socket newbie, losing a few chars from server to client
    By registering in forum Linux Programming
    Replies: 2
    Last Post: 06-07-2003, 12:48 PM
  5. Next Question...
    By Azmeos in forum C++ Programming
    Replies: 3
    Last Post: 06-06-2003, 03:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21