문제

I would like to design webapps (eg. games) that have low latency. I presume that the header of ajax would add latency. What I really would like is a protocol where the connection is never broken, and both client and server can push data to each other immediately. (and thus comet isn't really a choice, since there is communication only one side). Better would be to send data as binary and compress it.

Edit: I want an alternative to java/flash/silverlight because my platform is ipad/iphone, which DOES NOT support java/flash/silverlight

Please do not recommend any thing that is/needs java/flash/silverlight, thank you

도움이 되었습니까?

해결책

Depending on your timeline and ability to impose user requirements, you could use WebSockets. See link text for info about browser support.

다른 팁

What you are probably looking for can most easily be accomplished using Flash and Socket programming in Actionscript. That will allow you to maintain a constant connection to a server (which you would also have to write, I would recommend Haxe for that), and provide a decently low latency for exchanging information.

Keep in mind though that communicating at this level will be challenging as you will be required to design your own protocol for packing and unpacking the data you send.

Flash, Java, and Silverlight all support sockets. This will give you a continuous connection w/o http headers that can allow data to be sent in either direction.

The downside is, it won't work in all network environments.

Look at BlazeDS which uses AMF as a serialization protocol between the two. BlazeDS is a Java server platform for building applications in Spring using AMF serialization to Flex/Flash applications. AMF is a binary protocol that has a very small footprint. There is an example floating around the net comparing JSON, XML, and AMF in flash applications.

http://www.jamesward.com/census/

http://insideria.com/2008/09/amf-vs-json-vs-xml.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top