NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP AND AOL Instant Messenger

Mark Armendariz nyphp at enobrev.com
Mon Oct 4 20:35:35 EDT 2004


You're going to want to follow Dan Cech's idea using child processes for
each connection.  Essentially, in order for php to run as a socket client,
it has to run an eternal loop which consistently checks the socket and
maintains the connection.  As explained, by the time a browser sees a php
generated page, php has been finished and closed the script and sent the
output to apache (or whatever other http app) to send to you.

Flash would be one of the best ways to go, and actionscript 2 is a treat to
work with if you're an oo fan (although the flash ide is a failure - if you
get into it, find another app with as2 code hinting / highlighting).

Unfortunately, you're going to run into an issue using any client side
solution.  Flash, javascript, etc will need to connect directly to the aol
servers which could be a problem with firewalls and proxies.  If you run the
connections for the server, they have access form the browser over good ol
highway 80 and you can control the chat app and the access to / from it.

Here's what seems to be a great implementation of php sockets talking to
aol's servers: http://www.rsbauer.com/webdev/aimsocket.txt

I've gotten it to work once in the past while trying to learn how to
implement it myself, but it's been a while.

Good luck!

Mark

(5 more hours in San Francisco airport due to delays and cancellations.  I
can't WAIT to get back to Brooklyn!)




More information about the talk mailing list