Package com.firefly.net.exception

Examples of com.firefly.net.exception.NetException


            }
            start = true;
            new Thread(this, "Tcp-worker: " + workerId).start();
        } catch (IOException e) {
            log.error("worker init error", e);
            throw new NetException("worker init error");
        }
    }
View Full Code Here


        // Clean up the stale messages in the write buffer.
        synchronized (session.getWriteLock()) {
            Object obj = session.getCurrentWrite();
            if (obj != null) {
                cause = new NetException("cleanUpWriteBuffer error");
                session.getCurrentWriteBuffer().release();
                session.resetCurrentWriteAndWriteBuffer();
                fireExceptionCaught = true;
            }

            Queue<Object> writeBuffer = session.getWriteBuffer();
            if (!writeBuffer.isEmpty()) {
                // Create the exception only once to avoid the excessive
                // overhead
                // caused by fillStackTrace.
                if (cause == null) {
                    cause = new NetException("cleanUpWriteBuffer error");
                }

                while (true) {
                    obj = writeBuffer.poll();
                    if (obj == null) {
View Full Code Here

    }

    @Override
    public void start(String host, int port) {
        if (config == null)
            throw new NetException("server config is null");
        log.debug(config.toString());
        listen(bind(host, port));
    }
View Full Code Here

  }

  @Override
  public void start(String host, int port) {
    if (config == null)
      throw new NetException("server config is null");
    log.debug(config.toString());
    listen(bind(host, port));
  }
View Full Code Here

      selector = Selector.open();
      start = true;
      new Thread(this, "Tcp-worker: " + workerId).start();
    } catch (IOException e) {
      log.error("worker init error", e);
      throw new NetException("worker init error");
    }
  }
View Full Code Here

    // Clean up the stale messages in the write buffer.
    synchronized (session.getWriteLock()) {
      Object obj = session.getCurrentWrite();
      if (obj != null) {
        cause = new NetException("cleanUpWriteBuffer error");
        session.getCurrentWriteBuffer().release();
        session.resetCurrentWriteAndWriteBuffer();
        fireExceptionCaught = true;
      }

      Queue<Object> writeBuffer = session.getWriteBuffer();
      if (!writeBuffer.isEmpty()) {
        // Create the exception only once to avoid the excessive
        // overhead
        // caused by fillStackTrace.
        if (cause == null) {
          cause = new NetException("cleanUpWriteBuffer error");
        }

        while (true) {
          obj = writeBuffer.poll();
          if (obj == null) {
View Full Code Here

  }

  @Override
  public void start(String host, int port) {
    if (config == null)
      throw new NetException("server config is null");
    log.debug(config.toString());
    listen(bind(host, port));
  }
View Full Code Here

      selector = Selector.open();
      start = true;
      new Thread(this, "firefly-tcp-worker: " + workerId).start();
    } catch (IOException e) {
      log.error("worker init error", e);
      throw new NetException("worker init error");
    }
  }
View Full Code Here

    boolean fireExceptionCaught = false;

    // Clean up the stale messages in the write buffer.
    Object obj = session.currentWrite;
    if (obj != null) {
      cause = new NetException("cleanUpWriteBuffer error");
      session.currentWriteBuffer.release();
      session.resetCurrentWriteAndWriteBuffer();
      fireExceptionCaught = true;
    }

    Queue<Object> writeBuffer = session.writeBuffer;
    if (!writeBuffer.isEmpty()) {
      // Create the exception only once to avoid the excessive
      // overhead
      // caused by fillStackTrace.
      if (cause == null) {
        cause = new NetException("cleanUpWriteBuffer error");
      }

      while (true) {
        obj = writeBuffer.poll();
        if (obj == null) {
View Full Code Here

TOP

Related Classes of com.firefly.net.exception.NetException

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.