FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP socket and NAT
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP socket and NAT [message #177120 is a reply to message #177119] Thu, 23 February 2012 10:32 Go to previous messageGo to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
On 2/23/2012 9:58 AM, SL wrote:
> This is not strictly a PHP question, it just springs into my mind while
> coding sockets in PHP.
>
> Assuming that I am communicating with 2 persons who are in the same LAN, say
> A& B.
>
> When I send some data to A, do I have to take care of the NAT (network
> address translation) ?
>
> Will the sockets take care of it automatically ?
>
> Thanks.
>
>

Hi,


NAT typically is used to change IP-addresses (and maybe port).
If A and B are in the same LAN I expect they can address each other
directly.
For example:
A IP: 192.168.178.22
B IP: 192.168.178.25

Once you go outside your LAN, you (might) need NAT.

And sockets have little to do with NAT.
A IP package arrives at a certain IP on a certain port: If some socket
is listening on that port on that machine, the package will be handled
by the listening process.

NAT itself is performed by routers and such, not by some service
listening to a port.

SO in short: No you have to care about it.

Disclaimer: If you are talking IP6, things are different.

Regards,
Erwin Moller

--
"That which can be asserted without evidence, can be dismissed without
evidence."
-- Christopher Hitchens
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: chat on web, Ajax ?
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 09:45:01 GMT 2024

Total time taken to generate the page: 0.07160 seconds