
August 4th, 2002, 10:44 PM
|
|
Junior Member
|
|
Join Date: Aug 2002
Posts: 10
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
PHP sockets
As i search through the list of books i need to read, i figured i would ask something here as well.
To my knowledge software on a web site written as a script (C++, PHP, Perl, etc...) could only be executed when a user sends a request to it. Meaning it's not running constantly, instead performs the task as hand each time a request is sent to it. Because it uses HTTP, it's connectionless. Each execution of the script is a different connection. One doesnt know anything about the other (unless session management is used). Follow me so far?
Then i came across articles on socket programming with PHP. The way these scripts were set up, they opened up port xxx and waited for a connection. I didnt think this was possible. THe program written in PHP was accepting a connection and sending data back and forth like it was 1 continuous session instead of multiple sessions(like normal scripts are).
I assume if this was done in PHP then the same could be done in CGI with C++ or Perl. THis would mean that a web based application could act as any other complex application handling users and creating a network.
Am i missing something? any help/comments are appreciated.
The only book i have on PHP/SQL did not talk about this at all.
|