How to get IP address will be used by HTTP in C++

Discussion in 'C++' started by jchliustuff@yahoo.com, Feb 1, 2008.

  1. Guest

    How to get IP address will be used by HTTP in C++

    At the client side, when my client machine talks to server, the server
    will see the IP address of my machine as part of HTTP request. My
    question is how I can programmatically get this IP address which will
    be used in HTTP request? I could use gethostname to get IP addresses,
    but that is a list. How can I tell which one will be used?

    Thanks very much in advance.

    Leo
     
    , Feb 1, 2008
    #1
    1. Advertising

  2. Sam Guest

    writes:

    > How to get IP address will be used by HTTP in C++


    There's no such thing as "HTTP" in C++.

    > At the client side, when my client machine talks to server, the server
    > will see the IP address of my machine as part of HTTP request. My
    > question is how I can programmatically get this IP address which will
    > be used in HTTP request? I could use gethostname to get IP addresses,
    > but that is a list. How can I tell which one will be used?


    That depends on your specific platform. Try a newsgroup that's appropriate
    for your operating system, that's oriented towards development topics. This
    has nothing to do with C++. You can also implement HTTP in Python and Perl,
    for example, and the same question applies.


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.7 (GNU/Linux)

    iD8DBQBHo583x9p3GYHlUOIRAuuCAJ9AgiN5gkIopE8zLFE95MWDXKx5VwCfWfmI
    KlGTkgxxWHrUQO0TmtfHdzc=
    =Kw6h
    -----END PGP SIGNATURE-----
     
    Sam, Feb 1, 2008
    #2
    1. Advertising

  3. Guest

    Thanks for your tip.

    Leo
     
    , Feb 1, 2008
    #3
  4. Christopher Guest

    On Feb 1, 4:22 pm, wrote:
    > How to get IP address will be used by HTTP in C++
    >
    > At the client side, when my client machine talks to server, the server
    > will see the IP address of my machine as part of HTTP request. My
    > question is how I can programmatically get this IP address which will
    > be used in HTTP request? I could use gethostname to get IP addresses,
    > but that is a list. How can I tell which one will be used?
    >
    > Thanks very much in advance.
    >
    > Leo


    alt.winsock and alt.winsock programming are probably the more
    frequented groups to consult for such things, although traffic isn't
    what I'd like it to be.
     
    Christopher, Feb 2, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    1,010
  2. serge calderara

    HTTP GET vs HTTP POST protocol

    serge calderara, Nov 4, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    611
  3. n3d!m

    Http post and http get

    n3d!m, Jan 25, 2012, in forum: Python
    Replies:
    2
    Views:
    361
    n3d!m
    Feb 6, 2012
  4. Robert S
    Replies:
    2
    Views:
    123
    Robert S
    Jul 23, 2006
  5. Replies:
    3
    Views:
    139
    MadMad
    Jul 10, 2007
Loading...

Share This Page