Examples of NetException


Examples of bm.net.NetException

                }
            }
        }
        if( lastException != null )
        {
            throw new NetException( Net.ERR_RC_INVOKATION, lastException );
        }
        else
        {
            return retval;
        }
View Full Code Here

Examples of bm.net.NetException

            // header, making virtual name server hosting to fail
            connection.setRequestProperty( "Host", connection.getHost() );
        }
        catch( IOException e )
        {
            throw new NetException( Net.ERR_HTTP_OPEN, e );
        }
    }
View Full Code Here

Examples of bm.net.NetException

            }
        }
        catch( IOException e )
        {
            log.error( e );
            throw new NetException( Net.ERR_HTTP_GET, e );
        }
    }
View Full Code Here

Examples of bm.net.NetException

            out = connection.openDataOutputStream();
            return out;
        }
        catch( IOException e )
        {
            throw new NetException( Net.ERR_HTTP_BEGIN_POST, e );
        }
    }
View Full Code Here

Examples of bm.net.NetException

            // Any 500 status number (500, 501) means there was a server error
            if( responseCode >= 500 )
            {
                log.error( "Server returned error code: " + responseCode + " " + responseMessage );
                throw new NetException( Net.ERR_HTTP_SERVER );
            }
            else if( responseCode != HttpConnection.HTTP_OK )
            {
                log.debug( "Server returned unhandled code: " + responseCode + " " + responseMessage );
                // ShouldDo: handle redirects?
                throw new NetException( Net.ERR_HTTP_UNHANDLED );
            }
            else
            {
                contentType = connection.getType();
                contentLength = (int) connection.getLength();
                log.debug( "content-type: " + contentType + ", content-length: " + contentLength );
            }
            in = new NetInputStream( this, connection.openDataInputStream() );
            return in;
        }
        catch( IOException e )
        {
            throw new NetException( Net.ERR_HTTP_IO, e );
        }
    }
View Full Code Here

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

Examples of com.firefly.net.exception.NetException

        // 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

Examples of com.firefly.net.exception.NetException

    }

    @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

Examples of com.firefly.net.exception.NetException

  }

  @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

Examples of com.firefly.net.exception.NetException

      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
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.