Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Streaming over http

Reply
Thread Tools

Streaming over http

 
 
Robert M. Gary
Guest
Posts: n/a
 
      01-13-2006
I'm attempting to web enable one of my java applications (for a variety
of reasons, including the https security).

In one case, my client expect to connect to the server long term and
just receive async information as it happens. That doesn't seem to fit
the http model. but I know its been done. Do you just do an HTTP_GET,
then hang, then reissue a new HTTP_GET after each piece of data?
DOesn't that cause a lot of disconnect/reconnects?

-Robert

 
Reply With Quote
 
 
 
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      01-13-2006
Robert M. Gary wrote:
> I'm attempting to web enable one of my java applications (for a variety
> of reasons, including the https security).
>
> In one case, my client expect to connect to the server long term and
> just receive async information as it happens.


What happens?

> That doesn't seem to fit
> the http model. but I know its been done. Do you just do an HTTP_GET,
> then hang, then reissue a new HTTP_GET after each piece of data?


Now you are mixing the directions. Does the server send notifications,
or does the client send requests?

> DOesn't that cause a lot of disconnect/reconnects?


HTTP is probably not the best protocol for a notification service. It is
a request/response protocol. So let's assume you mean requests with long
periods of inactivity between them.

Protocol-wise you can keep the connection if you use an HTTP
implementation which can do persistent connections. Even in HTTP 1.1
persistent connections are optional, although they are highly
recommended, and typically they are implemented.

But that alone doesn't help. You need to keep the connection alive to
avoid timeouts.

However, if you requests are indeed sporadic, I don't see the need to
keep the connection alive. Why have a connection hanging around and
using some resources if you just once in a while use it?

I really can't remember which HTTP version the standard library does,
and if it does persistent connections. You have to investigate that for
a start.

/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/
 
Reply With Quote
 
 
 
 
Robert M. Gary
Guest
Posts: n/a
 
      01-13-2006
Are there no examples of http streaming with Java? Is see a lot of
products that advertise streaming video over http. How did those
programmer implement their algorithms in http's traditional
request,response,disconnect structure?

-Robert

 
Reply With Quote
 
Oliver Wong
Guest
Posts: n/a
 
      01-13-2006

"Robert M. Gary" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Are there no examples of http streaming with Java? Is see a lot of
> products that advertise streaming video over http. How did those
> programmer implement their algorithms in http's traditional
> request,response,disconnect structure?


I believe this is usually done with two (or more) threads, like a
solution for the producer-consumer problem. A producer connects to a server
via HTTP, makes a request, and starts copying the response into a buffer.
When the consumer feels that enough data has been buffered to ensure smooth
playback, the consumer starts consuming the buffer, and rendering it on
screen.

- Oliver


 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      01-14-2006
On 13 Jan 2006 09:20:09 -0800, "Robert M. Gary" <(E-Mail Removed)>
wrote, quoted or indirectly quoted someone who said :

>Are there no examples of http streaming with Java? Is see a lot of
>products that advertise streaming video over http. How did those
>programmer implement their algorithms in http's traditional
>request,response,disconnect structure?


Streaming is best done with UDP so you just discard packets that don't
arrive in time and do the best you can. So you are not using HTTP.

To do it with HTTP you could just ask for a giant file, and start
sending it. HTTP does not necessarily tell you how big the file is to
start. The receiver buffers up x seconds before starting the video,
and if it ever outruns the buffer, it just stops and lets the buffer
fill again, so on a slow line in lurches along, put plays full speed
when it can.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      01-16-2006
Robert M. Gary wrote:
> Are there no examples of http streaming with Java? Is see a lot of
> products that advertise streaming video over http. How did those
> programmer implement their algorithms in http's traditional
> request,response,disconnect structure?


Streaming over HTTP is done in may different ways. Often the streaming
in the end is not done via HTTP, but just initiated via HTTP. E.g.:

- The server just sends an "endless" file in its response, with a
corresponding media mime type.

- The server sends back some proprietary data with a MIME type which is
actually associated with some other application. The browser hands the
data over to that other application, e.g. some media player. That other
application interprets the data as some information on how to access a
stream, and does so.

- The server sends back some standardized contend description, e.g.
SMIL. The browser hands the data over to some application which can deal
with it.

- The server sends back some HTML which has an embedded player object
definition. The browser starts the player with the parameters provided
in the HTML (one being the actual streaming source) and the player
accesses that source.

There are probably some more techniques.

/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq
http://www.uni-giessen.de/faq/archiv....java.gui.faq/
 
Reply With Quote
 
Haider Albassam
Guest
Posts: n/a
 
      01-17-2006
I think it should be something like AJAX so try to see how does it
work.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating tar file and streaming it over HTTP? pbienst Python 8 01-13-2010 05:32 AM
Push Server, Remoting Over Http,Real Time Data,Streaming, How Is this Done? batista ASP .Net 3 09-04-2009 12:21 AM
VOIP over VPN over TCP over WAP over 3G Theo Markettos UK VOIP 2 02-14-2008 03:27 PM
Problem with file streaming over HTTP andrea azzini ASP General 0 02-01-2005 04:45 PM



Advertisments