How Are Sockets Implemented in PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bobber205
Forum Newbie
Posts: 1
Joined: Thu Apr 30, 2009 2:21 pm

How Are Sockets Implemented in PHP?

Post 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
xplore
Forum Newbie
Posts: 16
Joined: Mon Apr 06, 2009 12:06 pm

Re: How Are Sockets Implemented in PHP?

Post 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.
Post Reply