Page 1 of 1

PHP Telnet... Yum Sockets

Posted: Fri Jan 10, 2003 11:29 am
by romeo
A long time ago when these forums started I remeber a thread about someone creating a full IRC interface use PHP and Sockets. I was wondering if anyone knows what happened to the project...
Not only because I love the idea but I want to write (unless you know of some outthere) a PHP Telnet program... so I can use PHP to Telnet into RPC's and such and use several macros to preform operations.

ANy and ALL feedback is Appreciated!

Posted: Fri Jan 10, 2003 12:07 pm
by BDKR
Hey romeo,

I did some work with sockets and created various servers and daemons to listen fro events here on our work backend. At the time, the sockets implementation had some issues. I'm not sure what the status of sockets in PHP are now. You can check the news group. I know there was a problem with reading from a socket. I was seeing it where would be read from the socket multiple times. I was forced to shelve the project until they get it sussed out.

I was working on a load balancer to balance traffic to a pool of read only databases. I also wrote a daemon to listen for signals from our cluster managers in the event of a failure of the primary database. It would basically tell one of the slaves to become the master.

Anyways, much of the work I was doing was based on phpServe or phpServ by Daniel Lorch. There is another PHP server project out there that is even more feature rich than phpServe but at this time I can't remember the name of it.

I'm planning on going back and spending more time with these projects as soon as some of the other stuff around here gets finished.

Another thing you might want to do is take a look at some of the examples in the manual. Toy with them a bit.

One thing that I tought about for a long time is the various approaches to how servers work. For example, Apache forks a child process to handle a request. However, our transaction server written by my boss in VB spins a new connection thread for each new connection. The server itself then polls each thread to see if it has a transaction to process. At this time, I've worked only with forking child processes, but would like to try the other way as well.

Anyways, let me know how it goes, or shoot an email if you want.

Here is the link to phpServ...
http://daniel.lorch.cc/projects/phpserv/

Cheers,
BDKR

bump

Posted: Mon Jan 13, 2003 12:45 am
by romeo
Maybe I should be looking towards Python?
IF you agree with this statement, please refer me to a book or site that deals with Python and Sockets :)

Posted: Mon Jan 13, 2003 7:18 am
by BDKR
Hey,

I noticed the IF OK?

Python may be a good idea. Check out the Twisted Matrix Library. The python socket implementation is a little more mature than PHP's at this point in time and the Twisted Matrix lib seems to have some good abstratction for dealing with it.

Cheers,
BDKR