stream_socket_client and /etc/hosts file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mike.coakley@gmail.com

    stream_socket_client and /etc/hosts file

    Does stream_socket_c lient use the /etc/hosts file? I'm using Mac OSX
    10.5.3 as a development platform and VMware Fusion for VM hosting. I
    have a OpenSUSE Linux VM that has an Apache 2 web server with multiple
    named virtual hosts. I use the Macs /etc/hosts file to provide DNS
    resolution for the development web sites. I can ping the DNS names and
    browse to them with no issues. For example:

    ping dev.example.com

    Works no problem (resolves to 172.16.182.128 - the IP VMware assigns
    to the Linux VM)

    Firefox & Safari can browse to dev.example.com no problem

    However if I use stream_socket_c lient with a URI of tcp://dev.example.com :80
    it fails.

    Any ideas?

    Mike
  • Jerry Stuckle

    #2
    Re: stream_socket_c lient and /etc/hosts file

    mike.coakley@gm ail.com wrote:
    Does stream_socket_c lient use the /etc/hosts file? I'm using Mac OSX
    10.5.3 as a development platform and VMware Fusion for VM hosting. I
    have a OpenSUSE Linux VM that has an Apache 2 web server with multiple
    named virtual hosts. I use the Macs /etc/hosts file to provide DNS
    resolution for the development web sites. I can ping the DNS names and
    browse to them with no issues. For example:
    >
    ping dev.example.com
    >
    Works no problem (resolves to 172.16.182.128 - the IP VMware assigns
    to the Linux VM)
    >
    Firefox & Safari can browse to dev.example.com no problem
    >
    However if I use stream_socket_c lient with a URI of tcp://dev.example.com :80
    it fails.
    >
    Any ideas?
    >
    Mike
    >
    Neither stream_socket_c lient() or any other call (ping, browser, etc.)
    use /etc/hosts. That is strictly part of TCP/IP's address resolution
    protocol (ARP) handling.

    Without the error, I have no idea what might be wrong.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • C. (http://symcbean.blogspot.com/)

      #3
      Re: stream_socket_c lient and /etc/hosts file

      On Jul 1, 1:49 am, Jerry Stuckle <jstuck...@attg lobal.netwrote:
      mike.coak...@gm ail.com wrote:
      Does stream_socket_c lient use the /etc/hosts file? I'm using Mac OSX
      10.5.3 as a development platform and VMware Fusion for VM hosting. I
      have a OpenSUSE Linux VM that has an Apache 2 web server with multiple
      named virtual hosts. I use the Macs /etc/hosts file to provide DNS
      resolution for the development web sites. I can ping the DNS names and
      browse to them with no issues. For example:
      >
      ping dev.example.com
      >
      Works no problem (resolves to 172.16.182.128 - the IP VMware assigns
      to the Linux VM)
      >
      Firefox & Safari can browse to dev.example.com no problem
      >
      However if I use stream_socket_c lient with a URI of tcp://dev.example.com :80
      it fails.
      >
      Any ideas?
      >
      Mike
      >
      Neither stream_socket_c lient() or any other call (ping, browser, etc.)
      use /etc/hosts.  That is strictly part of TCP/IP's address resolution
      protocol (ARP) handling.
      >
      Without the error, I have no idea what might be wrong.
      No....ARP is a layer 2 protocol (Data Link) while IP name to address
      conversion is Layer 3 (network).

      But each method described should yield the same result since the TCP/
      IP stack entry point is more or less the same and above the resolver
      (whose job it is to turn IP names into addresses).

      An error message would be helpful. Or try capturing the network
      packets.

      C.

      Comment

      • Jerry Stuckle

        #4
        Re: stream_socket_c lient and /etc/hosts file

        C. (http://symcbean.blogspot.com/) wrote:
        On Jul 1, 1:49 am, Jerry Stuckle <jstuck...@attg lobal.netwrote:
        >mike.coak...@g mail.com wrote:
        >>Does stream_socket_c lient use the /etc/hosts file? I'm using Mac OSX
        >>10.5.3 as a development platform and VMware Fusion for VM hosting. I
        >>have a OpenSUSE Linux VM that has an Apache 2 web server with multiple
        >>named virtual hosts. I use the Macs /etc/hosts file to provide DNS
        >>resolution for the development web sites. I can ping the DNS names and
        >>browse to them with no issues. For example:
        >>ping dev.example.com
        >>Works no problem (resolves to 172.16.182.128 - the IP VMware assigns
        >>to the Linux VM)
        >>Firefox & Safari can browse to dev.example.com no problem
        >>However if I use stream_socket_c lient with a URI of tcp://dev.example.com :80
        >>it fails.
        >>Any ideas?
        >>Mike
        >Neither stream_socket_c lient() or any other call (ping, browser, etc.)
        >use /etc/hosts. That is strictly part of TCP/IP's address resolution
        >protocol (ARP) handling.
        >>
        >Without the error, I have no idea what might be wrong.
        >
        No....ARP is a layer 2 protocol (Data Link) while IP name to address
        conversion is Layer 3 (network).
        >
        But each method described should yield the same result since the TCP/
        IP stack entry point is more or less the same and above the resolver
        (whose job it is to turn IP names into addresses).
        >
        An error message would be helpful. Or try capturing the network
        packets.
        >
        C.
        >
        True - don't know what I was thinking. It's been a long time since I
        wrote any of the underlying TCP/IP code - like around 20 years :-)

        But either way - it's TCP/IP which handles it.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • mike.coakley@gmail.com

          #5
          Re: stream_socket_c lient and /etc/hosts file

          The call is reporting the following:

          Error # : -1081773134
          Error String : ""

          I'm calling the function with a timeout of 15 and the
          STREAM_CLIENT_C ONNECT flag.

          Thanks for the comments so far. (I was going to comment on the ARP
          resolution and DNS stuff but someone beat me to it. And just to add to
          that conversation DNS would be more of an application layer protocol
          since it is more like to SMTP than an actual network protocol - like
          ARP, ICMP, TCP, UDP, etc... Basically DNS isn't needed to make the
          network work and is really only required by humans and other higher
          level protocols. I've designed enterprise networks and security for
          years now - taking time off of programming and now back to programming
          - so I've got what isn't working, just not sure from a PHP level why?)

          Mike

          Comment

          • Jerry Stuckle

            #6
            Re: stream_socket_c lient and /etc/hosts file

            mike.coakley@gm ail.com wrote:
            The call is reporting the following:
            >
            Error # : -1081773134
            Error String : ""
            >
            I'm calling the function with a timeout of 15 and the
            STREAM_CLIENT_C ONNECT flag.
            >
            Thanks for the comments so far. (I was going to comment on the ARP
            resolution and DNS stuff but someone beat me to it. And just to add to
            that conversation DNS would be more of an application layer protocol
            since it is more like to SMTP than an actual network protocol - like
            ARP, ICMP, TCP, UDP, etc... Basically DNS isn't needed to make the
            network work and is really only required by humans and other higher
            level protocols. I've designed enterprise networks and security for
            years now - taking time off of programming and now back to programming
            - so I've got what isn't working, just not sure from a PHP level why?)
            >
            Mike
            >
            Do you get false returned from the function or something else?

            What's the actual code you're using?


            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            Working...