Package org.auto.comet

Examples of org.auto.comet.SocketManager


  }

  protected void initSocketManager(CometConfigMetadata cometConfig)
      throws ServletException {
    SocketManager socketManager = creatSocketManager();
    socketManager.startTimer();
    Integer timeout = cometConfig.getTimeout();
    if (null != timeout) {
      long asyncTimeout = (long) (60000l * timeout);
      socketManager.setAsyncTimeout(asyncTimeout);
    }
    this.socketManager = socketManager;
  }
View Full Code Here


  }

  public void service(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    SocketManager socketManager = getSocketManager();

    String synchronizValue = getSynchronizValue(request);
    if (null == synchronizValue) {// 同步值为空则为接收消息
      receiveMessage(socketManager, request, response);
    } else if (Protocol.CONNECTION_VALUE.equals(synchronizValue)) {// 创建链接请求
View Full Code Here

    return request.getParameter(Protocol.CONNECTIONID_KEY);
  }

  protected static SocketManager creatSocketManager() {
    SocketStore socketStore = new LocalSocketStore();
    SocketManager socketManager = new SocketManager(socketStore);
    return socketManager;
  }
View Full Code Here

TOP

Related Classes of org.auto.comet.SocketManager

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.