473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Sending data to users browser by server push

258 100+
Hi everyone
I know this post does not belong in PHP forum but I really didn't know where to post it.

I'v made a PHP shopping cart for some markets that allows the owner to log in to admin area and wait for customers to order.

Orders should be shown in the admin page as soon as the customers make them.

Right now i'm sending request to server every 5 second by Action Script 3 (Flash) to check the database to see if there are new orders on the database.

BUT the problem is that this website could not be used for more than 10 owners at a time because it would be several requests sent to server each second. I'll need a really fast server to take requests for hundreds of market owners..


So, The question is if it's possible to send the data automatically to the users browser when a new order is made instead of checking the server every second?

I'v heard about something called Server Push that sends data from server to users browser but I don't know how it works.

Can anyone help me with this?

Any help will be appreciated.

Thanks / Behzad
Jul 26 '10 #1

✓ answered by Atli

It seems so, yes:
http://www.adobe.com/livedocs/flash/...et/Socket.html

That's just a basic socket class, so you should be able to make any kind of request on the server. The example on that site seems to do exactly what you are trying to do though.

But I am not a Flash (or ActionScript) expert in any way, so I can't really tell you whether or not that works. If you need more help with AS3 you would be better of starting a new thread in the Flash forums.

3 3690
Atli
5,058 Expert 4TB
So, The question is if it's possible to send the data automatically to the users browser when a new order is made instead of checking the server every second?
It is, yes, but it's not "simple". The web (as it is) was not built for stuff like this, so it requires a bit of hacking. See http://ajaxpatterns.org/HTTP_Streaming.

In HTML5, we will also be able to use Web Sockets, which will allow us to do this sort of stuff much more easily. We will be able to use simple JavaScript to open up a real-time connection to a server and exchange data.

Today you will need a client applet to do this. Both Java and Flash should be able to do that.
Jul 26 '10 #2
bnashenas1984
258 100+
Thanks Atli
I appreciate your help.
I'v been programming with PHP and AS3 for a while but i'v never been close to learning JAVA.

So it was a bit hard for me to understand the structure of the JAVA applet.

Do you know if it's possible to do the same thing with AS3 (Flash)?

Thanks again
Jul 26 '10 #3
Atli
5,058 Expert 4TB
It seems so, yes:
http://www.adobe.com/livedocs/flash/...et/Socket.html

That's just a basic socket class, so you should be able to make any kind of request on the server. The example on that site seems to do exactly what you are trying to do though.

But I am not a Flash (or ActionScript) expert in any way, so I can't really tell you whether or not that works. If you need more help with AS3 you would be better of starting a new thread in the Flash forums.
Jul 27 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Michele | last post by:
Hi all, I have developed a PHP-based website where a "planner" user can make up schedules of activities to be performed, storing them into MySQL tables. Afterwards, other "watcher" users can...
3
by: John Bradbury | last post by:
I want to send updates from a long running cgi. I have tried copying perl examples of server push and can not get them to work. Does anyone have an idiot proof example of a working server push or...
3
by: DesignerX | last post by:
At a certain page in my web app I'm entering users into a Queue for processing, how can I do a server push (like the expedia 'searching for flights' screen) that can display a progress page then...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
4
by: Trollpower | last post by:
Greetings, im totally new to ASP.Net, so i hope you can help me out here. Ive got some ActiveX Controls, which work great with Windows Forms. Now i have to do some work with ASP.Net, where i...
4
by: Susan Baker | last post by:
Is it possible to "push" data from a server to a client, using PHP server side scripting?. An example script will be very useful. Thanks
3
by: petermichaux | last post by:
Hi, I am trying to put together the last major pieces of my project's puzzle. This is more website/client-side architecture than JavaScript syntax but I hope this is a good place to ask. I'm a...
0
by: pintu | last post by:
Hi..I posted my message earlier but it was not properly described..so am posting again. I am working in an application in which i hav to send the contents of an xml file(from my local machine)...
1
by: K Viltersten | last post by:
I've used the following <input type="hidden" ID="Carrier" runat="server" value="abc" /> Then, in JS i set the value to "oink". I've checked using a debugger that the value actually resides...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.