태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

'Ajax'에 해당되는 글 2건

  1. 2008/01/17 fdajax (Full duplex ajax) 설치 및 데모실행 (2)
  2. 2008/01/15 Comet 기술이란...?

fdajax 0.9버전을 기준으로 설치법을 설명하겠다.

lighttpd 모듈로써 설치가 되는데  파일에 첨부된 파일을 보면 다음과 같은 설치 문서가 들어있다.


FdAjax module version 0.9, Thu, Jul 22, 2007

FdAjax short compilation and installation doc (http://www.refwell.com/blog).

1. Download and unpack Lighttpd 1.4.15 sources (http://www.lighttpd.net/download/).

2. Copy FdAjax source files to Lighttpd src directory.

3. Run ./configure  --prefix=/usr/local/lighttpd
3a. You can enable other configure options, e.g. --with-openssl

4. Run make

5. Run ./configure --enable-maintainer-mode --prefix=/usr/local/lighttpd
 
6. Add the following lines to src/Makefile.am file (http://trac.lighttpd.net/trac/wiki/HowToWriteALighttpdPlugin).

lib_LTLIBRARIES += mod_fdajax.la
mod_fdajax_la_SOURCES = mod_fdajax.c mod_fdajax_parser.c mod_fdajax_peercall.c mod_fdajax_info.c mod_fdajax_users.c mod_fdajax_alerts.c mod_fdajax_chat.c mod_fdajax_messages.c mod_fdajax_windows.c mod_fdajax_groups.c mod_fdajax_events.c
mod_fdajax_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_fdajax_la_LIBADD = $(common_libadd)

7. Run make

7a. Make sure that new Makefile files were generated.  In case of problems with compilation download and install latest automake and autoconf packages.


이 방식으로 설치가 안되서 애를 먹었는데 autoconf 버전문제였다.

6번과 7번사이에 다음을 실행해주면 된다.
autoreconf -fi

설치가 완료되면 lighttpd 의 /lib 디렉토리에

mod_fdajax.la
mod_fdajax.so

두개의 파일이 생성이 된다.

이렇게 되면 테스트를 할 준비가 완료가 된것이다.

PHP를 인스톨하면 example로 들어있는 웹채팅이 실행 가능하다.

lighttpd는 FastCGI방식으로 php를 실행할수 있는데 자세한 설명은 다음 주소에 나와있다.

http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP


내가 설치해본 데모는 다음 주소에서 볼수 있다.
http://211.218.209.242/

active-x 나 별다른 클라이언트없이 인터렉티브한 웹어플리케이션을 구현할수있다.

실행화면 스샷이다.

사용자 삽입 이미지



Posted by Breeze.Kang

댓글을 달아 주세요

  1. 우올.. 좋은 팁 감사합니다. 궁금했었는데... 좋은 reference 가 생겼네요. ^^
    잘 지내시죠? 새로 오픈하신 서비스 대박 나시길 기원할께요.. 늦었지만 새해 복 많이 받으시고요.. (__)

    2008/01/18 00:08 [ ADDR : EDIT/ DEL : REPLY ]
    • 네 반갑습니다. 잘지내시죠? 역삼역근처 오시면 연락 함 주세요~ 식사나 같이 하시죠

      2008/01/18 09:52 [ ADDR : EDIT/ DEL ]

wekipedia의 정의를 빌려보자.

http://en.wikipedia.org/wiki/Comet_(programming)

Comet is a World Wide Web application architecture in which a web server sends data to a client program (normally a web browser) asynchronously without any need for the client to explicitly request it. It allows creation of event-driven web applications, enabling real-time interaction otherwise impossible in a browser. Though the term Comet was coined in 2006,[a] the idea is several years older, and has been called various names, including server push, HTTP push, HTTP streaming, Pushlets, Reverse Ajax, and others.

Comet applications use long-lived HTTP connections between the client and server, which the server can respond to lazily, pushing new data to the client as it becomes available. This differs from the original model of the web, in which a browser receives a complete web page in response to each request, and also from the Ajax model, in which browsers request chunks of data, used to update the current page. The effect is similar to applications using traditional Ajax with polling to detect new information on the server, but throughput is improved and latency and server load are decreased.

Comet does not refer to any specific technique for achieving this user-interaction model, but encompasses all of them?though it implies the use of browser-native technologies such as JavaScript as opposed to proprietary plugins. Several such techniques exist, with various trade-offs in terms of browser support and side effects, latency, and throughput.

요약하자면, comet이란 서버에서 데이터를 클라이언트로 asynchronous하게 보내주는 아키텍처이다.

기존의 웹어플리케이들이 주로 client에서(주로 웹브라우저) request를 던지면 response를 주는 방식이었다면 코멧기술은 request없이(혹은 매우 긴 주기로)서버에서 데이터를 밀어넣어주는 기술을 말한다.

간단하게 생각한다면 주식거래를 하는 홈 트레이딩 시스템을 생각해보면 서버에서 주식거래량과 주식가격을 항상 밀어넣어주고 있는것과 같다. 단지 그 기술이 웹브라우저 같은 클라이언트에서 구현이 된다고 생각하면 된다.

실제 구현은 두가지 방식으로 가능한데..

1. Streaming
이 방식은 커넥션을 항상 유지하는 방식이고 서버에서 내려주는 데이터를 브라우저에서 받아서 필요한 부분만 처해주면 된다.

2. Long Polling
이 방식은 각 이벤트 마다 커넥션을 client에서 요청하고 서버에서는 response를 보내기전까지 계속 커넥션을 유지하다가 response를 보낸후에 커넥션을 끊는다. 그 후에 브라우저에서는 바로 다시 커넥션을 맺어서 response가 오기전까지 유지한다.  일반적인 웹어플리케이션과 유사하나 request의 주기가 길어짐으로서 성능 향상을 꽤할수 있고 , 1번 방식을 흉내낸 방식이라고 생각하면 될꺼 같다.


1번과의 차이점은 커넥션의 consistency에 있지만 너무 자주 이벤트가 일어난다면 1번이 더 효율적인 방식이다.

실제 구현을 하고 있는 어플리케이션은

lighttpd를 이용한  FDAjax(Full-Duplex Ajax) 모듈이 있다.

http://www.fdajax.com/wiki/index.php?title=Main_Page




 

Posted by Breeze.Kang

댓글을 달아 주세요