Connecting Tech Pros Worldwide Help | Site Map

stream_socket_client and /etc/hosts file

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 30th, 2008, 07:15 PM
mike.coakley@gmail.com
Guest
 
Posts: n/a
Default stream_socket_client and /etc/hosts file

Does stream_socket_client 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_client with a URI of tcp://dev.example.com:80
it fails.

Any ideas?

Mike

  #2  
Old July 1st, 2008, 12:55 AM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: stream_socket_client and /etc/hosts file

mike.coakley@gmail.com wrote:
Quote:
Does stream_socket_client 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_client with a URI of tcp://dev.example.com:80
it fails.
>
Any ideas?
>
Mike
>
Neither stream_socket_client() 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@attglobal.net
==================

  #3  
Old July 1st, 2008, 08:35 AM
C. (http://symcbean.blogspot.com/)
Guest
 
Posts: n/a
Default Re: stream_socket_client and /etc/hosts file

On Jul 1, 1:49*am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
mike.coak...@gmail.com wrote:
Quote:
Does stream_socket_client 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:
>
Quote:
ping dev.example.com
>
Quote:
Works no problem (resolves to 172.16.182.128 - the IP VMware assigns
to the Linux VM)
>
Quote:
Firefox & Safari can browse to dev.example.com no problem
>
Quote:
However if I use stream_socket_client with a URI of tcp://dev.example.com:80
it fails.
>
Quote:
Any ideas?
>
Quote:
Mike
>
Neither stream_socket_client() 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.
  #4  
Old July 1st, 2008, 11:15 AM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: stream_socket_client and /etc/hosts file

C. (http://symcbean.blogspot.com/) wrote:
Quote:
On Jul 1, 1:49 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
Quote:
>mike.coak...@gmail.com wrote:
Quote:
>>Does stream_socket_client 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_client with a URI of tcp://dev.example.com:80
>>it fails.
>>Any ideas?
>>Mike
>Neither stream_socket_client() 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@attglobal.net
==================

  #5  
Old July 1st, 2008, 09:55 PM
mike.coakley@gmail.com
Guest
 
Posts: n/a
Default Re: stream_socket_client 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_CONNECT 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
  #6  
Old July 2nd, 2008, 02:15 AM
Jerry Stuckle
Guest
 
Posts: n/a
Default Re: stream_socket_client and /etc/hosts file

mike.coakley@gmail.com wrote:
Quote:
The call is reporting the following:
>
Error # : -1081773134
Error String : ""
>
I'm calling the function with a timeout of 15 and the
STREAM_CLIENT_CONNECT 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@attglobal.net
==================

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.