any body can tell me if I can develope a chat server by PHP ?
Im new to PHP.
developing chat server by PHP
Moderator: General Moderators
-
saryon
- Forum Newbie
- Posts: 8
- Joined: Fri Jul 05, 2002 2:59 am
- Location: Leiden, Netherlands
- Contact:
irc chat server?
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
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
-
saryon
- Forum Newbie
- Posts: 8
- Joined: Fri Jul 05, 2002 2:59 am
- Location: Leiden, Netherlands
- Contact:
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........
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!!!!!!!!!!!!!
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)
http://marc.theaimsgroup.com/?l=php-dev ... 202033&w=2
just found this site......READ IT.....it's VERY good (the code that is)