- PHP Freaks
- → Viewing Profile: Recent Posts: JasonLewis
JasonLewis
Member Since 23 Apr 2006Offline Last Active May 16 2013 06:33 AM
Community Stats
- Group Members
- Active Posts 3,351
- Profile Views 3,134
- Member Title Advanced Member
- Age 22 years old
- Birthday January 31, 1991
-
Gender
Male
-
Location
Victoria, Australia
User Tools
Friends
JasonLewis hasn't added any friends yet.
Posts I've Made
In Topic: About The New Forums
20 October 2012 - 05:27 AM
In Topic: Migrating to IPB
26 August 2012 - 05:20 AM
Good luck to you!
In Topic: Timezone Syncing
13 April 2012 - 11:20 PM
As an educated guess I'd say Twitter keeps the timezone setting as a server-side fall back in case something goes wrong client-side. Fair enough. I've gone the same way.
I'm using PHPDate for jQuery to make formatting my dates easier and also using this conversion script found on StackOverflow.
This has turned into a client-side thing now. Ah well, hopefully this can help someone.
In Topic: NodeJS + socket.io + PHP to achieve real-time notifications
21 March 2012 - 05:09 AM
Once I get it working properly I'll post how I did it all for future reference.
In Topic: NodeJS + socket.io + PHP to achieve real-time notifications
21 March 2012 - 01:26 AM
What I'm getting at is this. Say I post a new update or something, when that update is inserting into the database should I push the notification through to socket.io which then broadcasts that notification to the connected clients? Does that sound feasible? What I want to try to avoid is polling the database every couple of seconds to check for new notifications. I'm using MySQL and I've read that other database's handle that sort of thing a tad better.
Edit:
This is a quote from another forum:
To communicate between php and web sockets I suppose you will need some comet solution. We did it on this way:
1. Have Redis (pub/sub feature) to send/retrieve messages (channel No is user ID)
2. Have PHP to send notifications into Redis when something happen
3. Have Node.js app listen all channels and send notification to web sockets
How to identify user:
1. After user login we added to Redis hash pair: sessionID => userID
1. After user connected to socket, it send auth command to node.js with session ID.
2. Node.js check hash in Redis for sessionID and get userID.
3. Node.js subscribe connection to userID channel
I can make sense of that... I'll just need to implement Redis since I don't have it at the moment.
- PHP Freaks
- → Viewing Profile: Recent Posts: JasonLewis
- Privacy Policy
- Forum Rules & Terms of Service ·




Find content