|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectp2ps.imp.rendezvous.RendezvousConnection
A class that maintains a connection to a rendezvous peer. This connection can either be rendezvous-to-rendezvous or peer-to-rendezvous
| Field Summary | |
static int |
PEER_TO_RENDEZVOUS
|
static int |
RENDEZVOUS_TO_RENDEZVOUS
|
| Constructor Summary | |
RendezvousConnection(int type,
java.lang.String peerid,
Endpoint endpoint,
Peer peer)
|
|
| Method Summary | |
void |
acceptConnection()
Initializes a connection to the rendezvous. |
void |
addConnectionListener(ConnectionListener listener)
Add a connection listener |
void |
close()
Closes the rendezvous connection |
void |
dataMessageReceived(DataMessageEvent event)
Called when the endpoint receives a data message |
Endpoint |
getEndpoint()
|
java.lang.String |
getPeerId()
|
int |
getType()
|
void |
initConnection()
Initializes a connection to the rendezvous. |
boolean |
isConnectionAccepted()
|
boolean |
isConnectionDeclined()
|
void |
notifyConnectionAccepted()
|
void |
notifyConnectionDeclined()
|
void |
notifyConnectionFailed()
|
void |
removeConnectionListener(ConnectionListener listener)
Remove a connection listener |
void |
send(byte[] bytes)
Sends the specified bytes to the connection. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PEER_TO_RENDEZVOUS
public static final int RENDEZVOUS_TO_RENDEZVOUS
| Constructor Detail |
public RendezvousConnection(int type,
java.lang.String peerid,
Endpoint endpoint,
Peer peer)
| Method Detail |
public void initConnection()
throws java.io.IOException
java.io.IOException - if no connection could be established
public void acceptConnection()
throws java.io.IOException
java.io.IOException - if no connection could be establishedpublic void addConnectionListener(ConnectionListener listener)
public void removeConnectionListener(ConnectionListener listener)
public int getType()
public java.lang.String getPeerId()
public Endpoint getEndpoint()
public boolean isConnectionAccepted()
public boolean isConnectionDeclined()
public void send(byte[] bytes)
throws java.io.IOException
java.io.IOExceptionpublic void close()
public void dataMessageReceived(DataMessageEvent event)
dataMessageReceived in interface EndpointMessageListenerpublic void notifyConnectionAccepted()
public void notifyConnectionDeclined()
public void notifyConnectionFailed()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||