Real Time Functionlity with php

Amin

I am working on attendance system where project management system is also handling using Javascript\Jquery at client side and PHP\MySQL at server side.

A feature in my web app is user message to admin. For this I have applied an ajax request which is made by setTimeout function (after every 15 seconds) to check that is there any new message comes in database if yes then return it to the admin.

It working fine but the drawback is (as you know) continuous request to server which really poor and bad. As I know that real time functionality can solve this problem I have checked some link websocket.io and signlR but there are applicable with Nodejs and asp.net. So, how can I apply real time functionality with php or I get that new data have reached in to database without continues request with ajax.

Calvin Froedge

There are actually some PHP tools for doing this now. For instance, check out Ratchet.

It's also possible to do bi-directional sockets by creating a simple TCP/IP server. I've done this before for bi-directional communication between a PHP server and a desktop app.

http://php.net/manual/en/sockets.examples.php

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related