|
Purple Code | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.purpletech.message.AbstractPeer
|
+--com.purpletech.message.BlockingPeer
A blocking message peer.
connect() starts a thread that listens for incoming messages
| Field Summary | |
protected java.lang.String |
host
|
protected int |
port
|
| Fields inherited from class com.purpletech.message.AbstractPeer |
doSendSystemMessages, listeners, outPrint, printer |
| Constructor Summary | |
BlockingPeer(java.lang.String host,
int port,
MessagePeerPrinter printer)
|
|
BlockingPeer(java.lang.String host,
int port,
java.io.PrintStream outPrint)
|
|
BlockingPeer(java.lang.String host,
MessagePeerPrinter printer)
|
|
BlockingPeer(java.lang.String host,
java.io.PrintStream outPrint)
|
|
| Method Summary | |
void |
connect()
Try to connect to the network |
void |
disconnect()
Try to disconnect from the server |
java.lang.String |
getHost()
|
protected java.io.InputStream |
getInputStream()
subclasses can override this to provide filters on the input stream |
protected java.io.OutputStream |
getOutputStream()
subclasses can override this to provide filters on the output stream |
int |
getPort()
|
boolean |
isConnected()
are we connected or not? |
Message |
receiveMessage()
Actively receive a message. |
void |
sendMessage(Message msg)
sends a message out across the pipe |
| Methods inherited from class com.purpletech.message.AbstractPeer |
addMessageListener, bind, getID, lookup, processSystemMessage, removeMessageListener, run, setSendSystemMessages, start, stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String host
protected int port
| Constructor Detail |
public BlockingPeer(java.lang.String host,
int port,
MessagePeerPrinter printer)
public BlockingPeer(java.lang.String host,
int port,
java.io.PrintStream outPrint)
public BlockingPeer(java.lang.String host,
MessagePeerPrinter printer)
public BlockingPeer(java.lang.String host,
java.io.PrintStream outPrint)
| Method Detail |
public java.lang.String getHost()
public int getPort()
protected java.io.OutputStream getOutputStream()
throws java.io.IOException
java.io.IOException
protected java.io.InputStream getInputStream()
throws java.io.IOException
java.io.IOException
public void connect()
throws java.io.IOException
connect in interface MessagePeerconnect in class AbstractPeerjava.io.IOExceptionpublic void disconnect()
MessagePeer
disconnect in interface MessagePeerdisconnect in class AbstractPeerpublic void sendMessage(Message msg)
sendMessage in interface MessagePeersendMessage in class AbstractPeerpublic Message receiveMessage()
Usually don't call this method; instead, call addMessageListener and wait for a notification.
receiveMessage in class AbstractPeerpublic boolean isConnected()
MessagePeer
isConnected in interface MessagePeerisConnected in class AbstractPeer
|
Documentation generated March 5 2003 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||