Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

javascript - Best approach for (cross-platform) real-time data streaming in PHP? -


i've been wondering how "true" (semi) real-time data streaming php.

possible applications: chat rooms, auctions, games, etc.

by "true", mean data not written somewhere , polled continuously, streaming client somehow.

by "semi", mean it's okay if stream server client real-time, , messages client server not.

for communication between client , server, i'd stick plain http (ajax) rather other protocol.

streaming client http possible manually flushing output buffer.

the question connect script on server-side?

and once it's connected, blocking read, rather polling changes.

the shared memory (shmop) extension work, it's not cross-platform.

perhaps memcached work? i'm not sure if there's way blocking read, comes down polling again - although i'm sure memcached pretty fast, don't idea of continuous polling.

any ideas?

php not suited implementing realtime data streaming. php slow, , not designed build multi-threaded applications. you'd better off implementing full blown socket server in language python or java.

that said, highly recommend checking out nodejs: http://nodejs.org/

it uses asynchronous event based model i/o, instead of having threads block in event loop. nodejs servers written in javascript. nodejs fast, scales, , has low learning curve.

clients connect nodejs http server using long polling ajax requests. php connect nodejs directly , push notifications. or php write message queue, or database, memcache etc, , nodejs poll data stores updates, , send new messages clients.

you possibly need write own daemon serve go between nodejs mysql, memcached, etc. when polling updates. nodejs keep socket open daemon process. daemon process poll data stores updates, , send updates nodejs. nodejs http server send updates clients.

see tutorial implementing realtime twitter stream: http://net.tutsplus.com/tutorials/javascript-ajax/learning-serverside-javascript-with-node-js/


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -