developing chat server by 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
blueriver
Forum Newbie
Posts: 8
Joined: Mon Jul 08, 2002 4:38 am

developing chat server by PHP

Post by blueriver »

any body can tell me if I can develope a chat server by PHP ?
Im new to PHP.
saryon
Forum Newbie
Posts: 8
Joined: Fri Jul 05, 2002 2:59 am
Location: Leiden, Netherlands
Contact:

irc chat server?

Post by saryon »

heh, if you're new, i don't suggest you go into one of the tougher regions of php ;)

For one, it's quite hard to get PHP to actually do something with sockets, and then
to get it to use it in such a way that you can use it unthreaded even though there are
lots of people connected to your irc server.
Also, since PHP isn't the fastest scripting language around (hell..most scripting languages are
as slow as driving an old lada up a hill), it's not really advantagious to use PHP for this.
If you are looking at it as a way to try out the sockets capability of PHP, try looking
around on the net on how to use sockets, and go check out the post i sent in earlier
on "php networking". (should be down only a few rows).

The best way, it seems to me, is to make a little loop that alternatively reads from sockets,
writes to sockets, and then checks for new connections.
THere's one major problem though....when reading from sockets, php tends to wait till it
gets input, and then go on with the code. But if you don't block the socket, the script
will run wild, and use 100% for as long as the script runs ;)
good luck with this ;)
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

yeah, the whole 'no threads' thing really limits what you can do. a Java applet would be better suited to what it sounds like you want to do. Although, if you still want to go through with trying it, saryon here's your man to talk to :D
blueriver
Forum Newbie
Posts: 8
Joined: Mon Jul 08, 2002 4:38 am

Thanks

Post by blueriver »

Thank you very much for your advice. Could u tell me any Website about chat technology & how to develop a chat server?
User avatar
llimllib
Moderator
Posts: 466
Joined: Mon Jul 01, 2002 2:19 pm
Location: Baltimore, MD

Post by llimllib »

I suggest you google it.
saryon
Forum Newbie
Posts: 8
Joined: Fri Jul 05, 2002 2:59 am
Location: Leiden, Netherlands
Contact:

Post by saryon »

simple google search:

http://rfc.net/rfc1459.html


This is the RFC for IRC servers, the de-facto standard sheet on how to create
a irc server.
the complete protocol explanation should be in there.

good luck........
saryon
Forum Newbie
Posts: 8
Joined: Fri Jul 05, 2002 2:59 am
Location: Leiden, Netherlands
Contact:

VERY VERY USEFUL!!!!!!!!!!!!!

Post by saryon »

VERY VERY USEFUL!!!!!!!!!!!!!

http://marc.theaimsgroup.com/?l=php-dev ... 202033&w=2



just found this site......READ IT.....it's VERY good (the code that is)
Post Reply