com.purpletech.message
Class QuoteBot
java.lang.Object
|
+--com.purpletech.message.MessageClient
|
+--com.purpletech.message.QuoteBot
- All Implemented Interfaces:
- MessagePeer, java.lang.Runnable
- public class QuoteBot
- extends MessageClient
- implements java.lang.Runnable
Runs N message bots. They constantly spew random quotes.
| Option | Description | Default |
| -n | number of clients to spawn | 1 |
| -h | host to connect to | 127.0.0.1 |
| -p | port | 12345 |
| -f | quote file | zippy.txt |
| -d | delay between sends (msec) | 2000 |
| -s | chance to stall between chars | 0 |
| -min | minimum stall time (msec) | 100 |
| -max | maximum stall time (msec) | 5000 |
- Version:
- $Id: QuoteBot.java,v 1.3 2002/11/24 05:32:55 alex Exp $
- Author:
- Alex
|
Constructor Summary |
QuoteBot(java.lang.String host,
int port,
java.lang.String fileQuotes,
int delay)
Initialize this object with a normal blocking peer. |
QuoteBot(java.lang.String host,
int port,
java.lang.String fileQuotes,
int delay,
double stall,
int min,
int max)
Initialize this object with a stalling peer. |
|
Method Summary |
protected java.io.InputStream |
getInputStream()
subclasses can override this to provide filters on the input
stream |
static void |
main(java.lang.String[] args)
|
void |
sendQuotes(int c)
|
| Methods inherited from class com.purpletech.message.MessageClient |
addMessageListener, bind, connect, disconnect, getHost, getID, getOutputStream, getPort, isConnected, lookup, processSystemMessage, receiveMessage, removeMessageListener, run, sendMessage, setSendSystemMessages, start, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.Runnable |
run |
QuoteBot
public QuoteBot(java.lang.String host,
int port,
java.lang.String fileQuotes,
int delay)
- Initialize this object with a normal blocking peer.
QuoteBot
public QuoteBot(java.lang.String host,
int port,
java.lang.String fileQuotes,
int delay,
double stall,
int min,
int max)
- Initialize this object with a stalling peer.
getInputStream
protected java.io.InputStream getInputStream()
throws java.io.IOException
- Description copied from class:
MessageClient
- subclasses can override this to provide filters on the input
stream
- Overrides:
getInputStream in class MessageClient
java.io.IOException
sendQuotes
public void sendQuotes(int c)
- Parameters:
c - number of quotes to send (-1 = infinite)
main
public static void main(java.lang.String[] args)