Threads and Sockets !!

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
sj1983msh
Forum Newbie
Posts: 15
Joined: Thu Feb 28, 2008 12:01 pm

Threads and Sockets !!

Post by sj1983msh »

Hi friends,

I have a question about sockets and threads in PHP.
Currently I have decided to improve my skills on Threads and Sockets Programming, because I want to implement a CHAT section in my website. So I heard from one of my close friends who once has done it before via Java language that I have to know enough of Threading methods and also Socket Programming.
I have searched over internet in order to find an Article about threading but almost I have not found any.
Please tell me what I need to know for coding a CHAT section.
And if I need Threads to be coded, where I can find a good article which can teach me necessary points. And also for sockets if I need it !

Thank you all

Sincerely Yours
Saman J.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Threads and Sockets !!

Post by s.dot »

I tried a socket chat once. Didn't get very far though indeed it's very possible! I ended up going with an AJAX solution using a database. It was much easier. :)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
sj1983msh
Forum Newbie
Posts: 15
Joined: Thu Feb 28, 2008 12:01 pm

Re: Threads and Sockets !!

Post by sj1983msh »

does that mean I don't need to know Threads?

If so, do you know where I can find some AJAX or Sockets (in PHP) articles related !?

Sincerely
S.J.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Threads and Sockets !!

Post by s.dot »

This is the tutorial I initially read and got a working chat from: http://code.jenseng.com/jenChat/

However, I then used the techniques applied in that tutorial and custom built my own chat.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Threads and Sockets !!

Post by Eran »

Check out phpsocketdaemon, a chat server written with PHP sockets - http://www.chabotc.com/phpsocketdaemon/
Post Reply