Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

raining.client
Class SBHttpClient  view SBHttpClient download SBHttpClient.java

java.lang.Object
  extended byraining.core.NioSocket
      extended byraining.client.HttpClient
          extended byraining.client.SBHttpClient

public class SBHttpClient
extends HttpClient

An HTTPClient that extends the basic HTTPClient, with the ability to generate loads. FOr Testing or loading : - how many concurrent connections (A) - how long to keep hitting URL - any pause between A's - max hits


Field Summary
(package private) static int[] bytesread
           
(package private) static int load
           
static int totalrcvd
           
static int totalsent
           
 
Fields inherited from class raining.client.HttpClient
absoluteUrl, contentLength, filename, getrequired, GETString, header_end, host, P, path, port, properties, proxyAuth, proxyBase64, proxyPort, proxyServer, responseCode, responseMessage, seen_header, u, useProxy
 
Fields inherited from class raining.core.NioSocket
acceptcount, acceptctr, activeSocketCount, ADD_EVENT, conncount, connctr, crcount, ctcount, debug, DEL_EVENT, id, READ_BUFFER_SIZE, readcount, REPORT_AFTER, rsb, selector, stopWhenIdle, totalBytesRead, WRITE_BUFFER_SIZE, writecount
 
Constructor Summary
SBHttpClient()
          Constructor to be used if you have created a GETString already.
SBHttpClient(java.lang.String Url)
          Constructor that takes absolute URL and splits it.
 
Method Summary
static int[] getLoadArray()
           
 void handle_read_complete(java.lang.String mdata)
          we implement our own processing here.
static void main(java.lang.String[] args)
           
static void setLoadArray(int mload)
           
 
Methods inherited from class raining.client.HttpClient
encode, getContentLength, getFileContentsAsArray, getHeaderField, getResponseCode, getResponseMessage, handle_read, makeGETString, makeGETString, makeGETString, push, setGETString, setHostPort, setProxy, setProxyAuthString
 
Methods inherited from class raining.core.NioSocket
accept_accounting, accept, add_to_map, channel, clear_read_buffer, conn_reset_handler, conn_time_out_handler, connect_accounting, create_client_socket, create_client_socket, create_server_socket, del_from_map, getReadData, getReadDataAsBuffer, getReadDataAsString, handle_accept, handle_close, handle_connect, handle_read_complete, handle_read_event, handle_terminator, handle_write_complete, handle_write_event, handle_write, is_read_complete, nio_close, on_exit_handler, readable, recv, resetSocketCounter, send, serverflag, setDebug, setReadBufferSize, setSendData, setSendData, setSendData, setWriteBufferSize, socketCount, socketCountChangeEvent, start, start, stop_now, stopWhenIdle, stopWhenIdle, writeable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

totalsent

public static int totalsent

totalrcvd

public static int totalrcvd

bytesread

static int[] bytesread

load

static int load
Constructor Detail

SBHttpClient

public SBHttpClient(java.lang.String Url)
             throws java.net.MalformedURLException,
                    java.io.IOException,
                    java.lang.Exception
Constructor that takes absolute URL and splits it. e.g. http://www.benegal.net/


SBHttpClient

public SBHttpClient()
             throws java.io.IOException,
                    java.lang.Exception
Constructor to be used if you have created a GETString already. this is required if you wish to blast one URL with many connections.

Method Detail

main

public static void main(java.lang.String[] args)

setLoadArray

public static void setLoadArray(int mload)

getLoadArray

public static int[] getLoadArray()

handle_read_complete

public void handle_read_complete(java.lang.String mdata)
Description copied from class: HttpClient
we implement our own processing here. e.g. we could write to disk or db. we would do any blocking writes in a thread if we want scalability.

Overrides:
handle_read_complete in class HttpClient