Examples of SocketHandler


Examples of java.util.logging.SocketHandler

    // start the server to be ready to accept log messages
    ServerThread thread = new ServerThread();
    thread.start();
    Thread.sleep(2000);

    h = new SocketHandler();
    h.setLevel(Level.INFO);

    h.close();
    assertEquals("MockFormatter_Head" + "MockFormatter_Tail", thread
        .getReadString());
View Full Code Here

Examples of java.util.logging.SocketHandler

          return new FileHandler(config.substring(5));
        } else if (config.startsWith("file")) {
          return new FileHandler("%h/modulizer%u.log");
        } else if (config.startsWith("socket:")) {
          final URI cfg = URI.create(config);
          return new SocketHandler(cfg.getHost(), cfg.getPort());
        } else {
          return null;
        }
      } catch (final Exception e) {
        log.log(Level.CONFIG, "invalid logging config: " + config, e);
View Full Code Here

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

Examples of org.auto.comet.SocketHandler

  /**
   * 断开链接
   * */
  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

Examples of rabbit.io.SocketHandler

    abstract void sendBuffer ();

    protected void waitForRead () {
  if (buffer.remaining () > 0)
      readStartPos = buffer.position ();
  SocketHandler sh = new Reader ();
  HandlerRegistration hr = new HandlerRegistration (sh)
  SocketChannel c = con.getChannel ();
  try {
      sk = c.register (con.getSelector (), SelectionKey.OP_READ, hr);
  } catch (IOException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.