BlowTorch
 All Classes Namespaces Files Functions Variables Enumerator Pages
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
com.offsetnull.bt.service.DataPumper Class Reference
Inheritance diagram for com.offsetnull.bt.service.DataPumper:
Inheritance graph
[legend]
Collaboration diagram for com.offsetnull.bt.service.DataPumper:
Collaboration graph
[legend]

Classes

class  OutputWriterThread
 

Public Member Functions

 DataPumper (final String host, final int port, final Handler useme)
 
final void sendData (final byte[] data)
 
final void init ()
 
final void sendWarning (final String str)
 
final void run ()
 
final void interruptSocket ()
 
final void corruptMe ()
 
final boolean isConnected ()
 
final void closeSocket ()
 
final Handler getHandler ()
 

Static Public Member Functions

static String toHex (final byte[] bytes)
 

Static Public Attributes

static final int MESSAGE_RETRIEVE = 100
 
static final int MESSAGE_END = 102
 
static final int MESSAGE_INITXFER = 103
 
static final int MESSAGE_ENDXFER = 104
 
static final int MESSAGE_COMPRESS = 105
 
static final int MESSAGE_NOCOMPRESS = 106
 
static final int MESSAGE_THROTTLE = 108
 
static final int MESSAGE_NOTHROTTLE = 109
 

Detailed Description

Data pumper thread implementation. This object manages itself as a thread, as well as a child thread process to write output data to.

Constructor & Destructor Documentation

com.offsetnull.bt.service.DataPumper.DataPumper ( final String  host,
final int  port,
final Handler  useme 
)

Generic constructor.

Parameters
hostHost name for the connection.
portPort number to use.
usemeHandler to report to when interesting things happen.

Member Function Documentation

final void com.offsetnull.bt.service.DataPumper.closeSocket ( )

Utility method to close the socket, including the reader and writer threads.

final void com.offsetnull.bt.service.DataPumper.corruptMe ( )

Utility function to corrup the MCCP stream.

final Handler com.offsetnull.bt.service.DataPumper.getHandler ( )

Getter for mHandler.

Returns
The mHandler handler for the reader thread.
final void com.offsetnull.bt.service.DataPumper.init ( )

Startup and initialization routine.

Here is the call graph for this function:

final void com.offsetnull.bt.service.DataPumper.interruptSocket ( )

Utility method to interrpt a blocked socket.

final boolean com.offsetnull.bt.service.DataPumper.isConnected ( )

Utility method to get if the socket is connected.

Returns
Weather or not the socket is connected.
final void com.offsetnull.bt.service.DataPumper.run ( )
final void com.offsetnull.bt.service.DataPumper.sendData ( final byte[]  data)

Sends data to the socket asynchronously.

Parameters
datathe bytes to send to the server.
final void com.offsetnull.bt.service.DataPumper.sendWarning ( final String  str)

Quick little helper method to send off a processor warning.

Parameters
strThe processor warning to send.
static String com.offsetnull.bt.service.DataPumper.toHex ( final byte[]  bytes)
static

Utility method to convert byte[] to a hex string.

Parameters
bytesThe byte array to convert.
Returns
The hex string representation.

Member Data Documentation

final int com.offsetnull.bt.service.DataPumper.MESSAGE_COMPRESS = 105
static

Contant indicating that compression should start.

final int com.offsetnull.bt.service.DataPumper.MESSAGE_END = 102
static

Constant indicating orderly shutdown via user.

final int com.offsetnull.bt.service.DataPumper.MESSAGE_ENDXFER = 104
static

Constant indicating the end of the data transfer.

final int com.offsetnull.bt.service.DataPumper.MESSAGE_INITXFER = 103
static

Constant indicating that data transfer should begin.

final int com.offsetnull.bt.service.DataPumper.MESSAGE_NOCOMPRESS = 106
static

Constant indicating that compression should end.

final int com.offsetnull.bt.service.DataPumper.MESSAGE_NOTHROTTLE = 109
static

Constant indicating that throttling should end.

final int com.offsetnull.bt.service.DataPumper.MESSAGE_RETRIEVE = 100
static

Constant indicating the socket polling loop.

final int com.offsetnull.bt.service.DataPumper.MESSAGE_THROTTLE = 108
static

Constant indicating that throttling should begin.


The documentation for this class was generated from the following file: