Page 1 of 1

How Are Sockets Implemented in PHP?

Posted: Thu Apr 30, 2009 2:26 pm
by bobber205
Last night I played with some sockets in php using socket_create() etc.

When I tried to connect to my local 192.168 ip, it worked fine. Connecting was fast and smooth. Data transfer was fine.

However, I could not connect using my ip or domain name I have with dyndns.

A few months ago I bought some PoS Netgear router that, among other issues, will not let me connect to my ip while inside the "subnet" or w/e you call it. ;) Outside my subnet, however, has worked fine till now.

For a school project, I have a basic data receiving service running on port 57422. Using regular C# sockets, my peers can connect to my "server" using the C# sockets just fine. I cannot connect using my domain name while inside the subnet as said before. But outside works fine.

Here's my question: Are sockets implemented differently in PHP than in C#? I did not see, when requesting to connect from the outside, the same kind of log messages as when connecting from the inside. I saw weird attempted connections on port 1900 on 238.255.255.255. Is this my router sucking it hardcore or should I have to open different ports for php?

Thanks! :D

Re: How Are Sockets Implemented in PHP?

Posted: Thu Apr 30, 2009 11:11 pm
by xplore
bobber205 wrote:Last night I played with some sockets in php using socket_create() etc.

When I tried to connect to my local 192.168 ip, it worked fine. Connecting was fast and smooth. Data transfer was fine.

However, I could not connect using my ip or domain name I have with dyndns.

A few months ago I bought some PoS Netgear router that, among other issues, will not let me connect to my ip while inside the "subnet" or w/e you call it. ;) Outside my subnet, however, has worked fine till now.

For a school project, I have a basic data receiving service running on port 57422. Using regular C# sockets, my peers can connect to my "server" using the C# sockets just fine. I cannot connect using my domain name while inside the subnet as said before. But outside works fine.

Here's my question: Are sockets implemented differently in PHP than in C#? I did not see, when requesting to connect from the outside, the same kind of log messages as when connecting from the inside. I saw weird attempted connections on port 1900 on 238.255.255.255. Is this my router sucking it hardcore or should I have to open different ports for php?

Thanks! :D
Ah I can't help you on the sockets question but having a good background thus far in networking I can tell you that 238.255.255.255 is a broadcast address used only for discovery. This is assuming that they aren't subnetting off the IP classes into smaller subnets of course.