Correct me if I'm wrong, but I think with UDP it's a bit diffrent: when in a localhost test mode you should use diffrent Ports for Server and Client, while you could use the same Ports when Server and Client are not on the same Machine.
Basicly accessing PHP Pages running on Apache is the same as any other TCP based HTTP Request: The server is using the assigned Port, usually 80, while the Client is using some Ports above 1024, incrementing Portnumbers for additional Streams etc. As far as I see you don't have to specify the Clients TCP Port, this is done automaticly by Winsocks or something, the Client only needs to define the Server Port. But, of course, maybe I am completely wrong here :)
Basicly accessing PHP Pages running on Apache is the same as any other TCP based HTTP Request: The server is using the assigned Port, usually 80, while the Client is using some Ports above 1024, incrementing Portnumbers for additional Streams etc. As far as I see you don't have to specify the Clients TCP Port, this is done automaticly by Winsocks or something, the Client only needs to define the Server Port. But, of course, maybe I am completely wrong here :)