Package org.auto.comet

Examples of org.auto.comet.SocketHandler


  }

  private void creatConnection(SocketManager socketManager,
      HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    SocketHandler service = getSocketHandler(request);
    if (null == service) {
      String uri = RequestUtils.getServletPath(request);
      throw new DispatchException("Cant find comet handler by [" + uri
          + "]. Did you registered it?");
    }

    PushSocket socket = new PushSocket();
    boolean accept = service.accept(socket, request);
    PrintWriter write = response.getWriter();
    String commend = null;
    if (accept) {// 如果接受连接请求则创建连接
      socketManager.creatConnection(socket);
      commend = JsonProtocolUtils.getConnectionCommend(socket.getId());
View Full Code Here


  /**
   * 断开链接
   * */
  private void disconnect(SocketManager socketManager,
      HttpServletRequest request) {
    SocketHandler handler = getSocketHandler(request);
    if (null == handler) {
      String uri = RequestUtils.getServletPath(request);
      throw new DispatchException("Cant find comet handler by [" + uri
          + "]. Did you registered it?");
    }
View Full Code Here

TOP

Related Classes of org.auto.comet.SocketHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.