'SDK'에 해당되는 글 4건

  1. 2014.02.04 Web Socket API
  2. 2013.06.22 Debugging Tools for Windows 독립 설치 버전 (1)
  3. 2013.02.05 Oracle Java SE Critical Patch Update
2014.02.04 19:13

Web Socket API

Web Socket API

The Web Socket protocol enables web applications to maintain bidirectional communications with server-side processes. The typhoonae.websocket package provides a Web Socket Service API for GAE applications. It was introduced by the TyphoonAE 0.1.2 release anddoes not run on the productive Google App Engine platform.

However, in order to enable the Web Socket API for the Google App Engine SDK, go through the following guide.

Patching the Google App Engine SDK (Python) to enable TyphoonAE's Web Socket API

To get an idea how Web Sockets could work with GAE download the SDK 1.5.0 patch from this location. It also includes a demo app and some basic instructions.

Web Borwsers Supporting Web Sockets

Overview

Since Bret Taylor came up with a neat implementation of a Web Socket handler for the Tornado web server, it's no longer a hassle to get an experimental Web Socket service up and running. A client can establish a Web Socket connection to the service which solely utilizes web hooks to dispatch messages to and from an application.


A client requests (1) a web page containing the Java Script call to establish a Web Socket connection (2) to a URL provided by the application. The application and Web Socket service communicate over web hooks (3, 4).

Sending and Receiving Web Socket Messages

We distinguish between two types of incoming Web Socket messages. A handshake message is received once per Web Socket session when the client establishes the connection. This type of message can be handled seperately by a request handler. All other incoming messages can be handled by another request handler. The API we use in our handshake handler as well as in the handler for all other incoming Web Socket messages doesn't differ. However, in many cases it is very useful to handle Web Socket handshake messages seperately from normalmessages.

In order to handle incoming Web Socket requests, add this script handler to the handlers section of the app.yaml file.

  - url: /_ah/websocket/.*
    script
: script.py
    login
: admin

Define the correct URL mapping for your WSGI application:

  app = google.appengine.ext.webapp.WSGIApplication([
   
('/_ah/websocket/handshake/(.*)', HandshakeHandler),
   
('/_ah/websocket/message/(.*)', MessageHandler),
 
], debug=True)

Our Web Socket API provides a convenience function to obtain the appropriate service URL. It has one argument for additional URI information:

  websocket_url = typhoonae.websocket.create_websocket_url('/foo/bar')

The following request handler receives and sends messages from and to a Web Socket. The POST method is used to receive an incoming message where the first non-self argument contains the additional URI information from above:

  class MessageHandler(google.appengine.ext.webapp.RequestHandler):
   
"""Handles Web Socket requests."""

   
def post(self, path):
      message
= typhoonae.websocket.Message(self.request.POST)
      typhoonae
.websocket.send_message(
       
[message.socket], 'Received: "%s"' % message.body)

message object has the two attributes socket and body. The former is a string containing the socket id. The latter contains our message body as a unicode string.

The client, usually a Web Socket capable browser, establishes a Web Socket by using Java Script:

  ws = new WebSocket("ws://example.com");

Broadcast Messages

TyphoonAE adds another very useful function which enables an app to broadcast messages to all currently open Web Sockets of an app. Without this convenient method a developer has to implement a solution to remember all open Web Sockets. By using broadcast_message the Web Socket service takes care of it.

  class MessageHandler(google.appengine.ext.webapp.RequestHandler):
   
"""Handles Web Socket requests."""

   
def post(self, path):
      message
= typhoonae.websocket.Message(self.request.POST)
      typhoonae
.websocket.broadcast_message(message.body)

Handling Closed Sockets

Applications sometimes should be informed when a socket is closed. Therefore, an app can implement a third request handler for the following URL pattern:

    '/_ah/websocket/closed/(.*)'

The success path can be utilized for keeping track of additional informations such as encoded user IDs.

  class SocketClosedHandler(google.appengine.ext.webapp.RequestHandler):
   
"""Handler for socket closed events."""

   
def post(self, path):
      user
= decode_user_from_path(path)
      typhoonae
.websocket.broadcast_message('%s has left the building' % user)

See http://dev.w3.org/html5/websockets/ for further information on Web Sockets.




출처 : code.google.com


Trackback 0 Comment 0
2013.06.22 19:24

Debugging Tools for Windows 독립 설치 버전

"Debugging Tools for Windows"가 예전에는 단독 설치 버전이 제공되었는데 최근 들어 Windows SDK/DDK 내로 합쳐지면서 부가적인 요소들이 함께 설치되도록 바뀌었습니다.

Download and Install Debugging Tools for Windows
; http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx


위의 웹 페이지에 "Install Debugging Tools for Windows as a Standalone Component" 라는 링크가 제공되긴 하지만, 엄밀히 단독 설치 버전은 아닙니다. 물론, 빠른 다운로드 속도로 크게 불편함은 없는데요. 그래도 한 가지 문제가 있습니다.

닷넷 응용 프로그램에 대한 테스트 환경을 구축하다 보면, 그래도 한 대 정도는 특정 버전만 설치되어야 제대로 테스트 되는 경우가 있습니다. 아래처럼!

System.MissingMethodException
; http://www.sysnet.pe.kr/2/0/909


그런데, "Download and Install Debugging Tools for Windows"에서 제공되는 모든 링크에서는 "Debugging Tools for Windows"와 함께 .NET 4.0 설치를 해버립니다.

웹 검색을 해보면, 여기 저기 듣보잡 웹 사이트에서 단독 설치 버전을 올려 놓은 것을 볼 수 있는데... 이 바닥에서 오래 일하다 보면 ^^ "공식 사이트"만을 고집하는 데에는 다 이유가 있다는 것을 알게 되죠. ^^ 그래서 좀 더 검색을 해보니 다행히 마이크로소프트 공식 사이트에서 제공되고 있는 것을 찾았습니다.

Debugging Tools for Windows 6.12.2.633 
; http://archive.msdn.microsoft.com/debugtoolswindows

dbg_amd64_6.12.2.633.msi
; http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=debugtoolswindows&DownloadId=13747

dbg_x86_6.12.2.633.msi
; http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=debugtoolswindows&DownloadId=13748


버전도 "Download and Install Debugging Tools for Windows"에서 제공되는 것보다 더 높다는 사실! ^^

 

 

출처 : http://blog.naver.com/techshare/


Trackback 0 Comment 1
  1. 2013.06.22 19:27 address edit & del reply

    비밀댓글입니다

2013.02.05 19:00

Oracle Java SE Critical Patch Update

□ 개요

   o Oracle Critical Patch Update(CPU)는 Oracle사의 제품을 대상으로 다수의 보안 패치를 발표하는 주요 수단임

   o 2013년 2월 1일(현지시각) Oracle Java SE CPU 발표 이후, 관련 공격코드의 출현으로 인한 피해가 예상되므로 Oracle Java SE 제품의 다중 취약점에 대한 패치하기를 권고함[1]


□ 설명

   o 2013년 2월 Oracle CPU에서는 Oracle Java SE 제품의 원격에서 악용될 수 있는 보안취약점 50개에 대한 패치를 발표함

     ※ 영향받는 시스템 및 취약점 상세 정보는 참고사이트[1]를 참조

  

□ 해당 소프트웨어

   ㅇ JDK ․ JRE 7 Update 11 및 이전버전

   ㅇ JDK ․ JRE 6 Update 38 및 이전버전

   ㅇ JDK ․ JRE 5.0 Update 38 및 이전버전

   ㅇ SDK ․ JRE 1.4.2_40 및 이전버전

   ㅇ JavaFX 2.2.4 및 이전버전


□ 해결방안

   o 설치된 제품의 최신 업데이트를 다운로드[2] 받아 설치하거나, Java 자동업데이트 설정을 권고[3]


□ 기타 문의사항

   o 한국인터넷진흥원 인터넷침해대응센터: 국번없이 118


[참고사이트]

[1] http://www.oracle.com/technetwork/topics/security/javacpufeb2013-1841061.html

[2] http://www.oracle.com/technetwork/java/javase/downloads/index.html

[3] http://www.java.com/ko/download/help/java_update.xml


Trackback 0 Comment 0