|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.joctopus.client.Client
public class Client
This bean is used for opening client sockets to a remote machine.
Field Summary | |
---|---|
static int |
BUFFER_SIZE
buffer size in // MB..default=1MB |
protected boolean |
debug
specifies debug mode, if true then output will be written to chatterconsole |
static int |
DEFAULT_PORT
default port for opening socket at remote machine,if not specified in constructor. |
static int |
FILE_TRANSFER
|
static int |
TEXT_CHAT
specifies type of messages passed,wheather text or binary messages,if size of message exceeds to kbs then file transfer should be best preferred. |
Constructor Summary | |
---|---|
Client()
Default constructor |
|
Client(java.net.InetAddress iDestination,
int port,
int mode,
JOctopusConsole chatterConsole)
|
|
Client(java.net.InetAddress iDestination,
int mode,
JOctopusConsole chatterConsole)
|
Method Summary | |
---|---|
void |
connect()
connects client to remote computer, can throw bind exception while sending muliple files, in such case it will wait for 300 ms and then again try to connect |
JOctopusConsole |
getChatterConsole()
|
java.net.InetAddress |
getIDestination()
|
java.io.InputStream |
getMessageAsStream()
|
java.lang.String |
getMessageAsText()
|
int |
getMode()
|
int |
getPort()
|
java.net.Socket |
getSocket()
|
java.nio.channels.SocketChannel |
getSocketChannel()
|
boolean |
isFail()
Get the value of fail |
void |
run()
sends message to client, can throw BindException when sending mutiple files in such case it will wait for 1000 ms and then again try to send file. |
void |
run0()
same as run() |
void |
sendMessage()
sends the message to remote machine. |
void |
setChatterConsole(JOctopusConsole chatterConsole)
|
void |
setIDestination(java.net.InetAddress iDestination)
sets the inetaddress of remote machine. |
void |
setMessageAsStream(java.io.InputStream messageAsStream)
sets the stream that represents the file on the local system. |
void |
setMessageAsText(java.lang.String messageAsText)
sets text message that will be sent at remote machine. |
void |
setMode(int mode)
sets the mode of operation i.e text or file transfer |
void |
setPort(int port)
sets port, to which this client will connect at remote host. |
void |
setSocketChannel(java.nio.channels.SocketChannel socketChannel)
|
void |
shutDownClient()
Closes all opened streams and channels |
void |
writeOut(java.lang.String message)
writes output to JOctopusConsole window |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_PORT
public static final int TEXT_CHAT
public static final int FILE_TRANSFER
protected boolean debug
public static int BUFFER_SIZE
Constructor Detail |
---|
public Client()
public Client(java.net.InetAddress iDestination, int port, int mode, JOctopusConsole chatterConsole)
iDestination
- port
- mode
- chatterConsole
- public Client(java.net.InetAddress iDestination, int mode, JOctopusConsole chatterConsole)
iDestination
- mode
- chatterConsole
- Method Detail |
---|
public JOctopusConsole getChatterConsole()
public void setChatterConsole(JOctopusConsole chatterConsole)
chatterConsole
- JOctopusConsole object for debugging purposespublic boolean isFail()
public void setSocketChannel(java.nio.channels.SocketChannel socketChannel)
socketChannel
- SocketChannel to set.public java.nio.channels.SocketChannel getSocketChannel()
public int getMode()
public void setMode(int mode)
mode
- public int getPort()
public void setPort(int port)
port
- public java.lang.String getMessageAsText()
public void setMessageAsText(java.lang.String messageAsText)
messageAsText
- public java.net.Socket getSocket()
public java.net.InetAddress getIDestination()
public void setIDestination(java.net.InetAddress iDestination)
iDestination
- public java.io.InputStream getMessageAsStream()
public void setMessageAsStream(java.io.InputStream messageAsStream)
messageAsStream
- public void sendMessage()
public void shutDownClient()
public void writeOut(java.lang.String message)
message
- public void connect()
public void run()
public void run0()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |