|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcgl.narada.transport.udp.UDPLinkFactory
cgl.narada.transport.up2p.UP2PLinkFactory
public class UP2PLinkFactory
This is a UDP based P2P connetion link implementation. It uses the UDP hole punching technique while leveraging the existing UDP Link factory for processing connections
To initialize the UP2PLinkFactory one needs to specify the following
To create a link to node B. The following properties needs to be specified.
| Field Summary |
|---|
| Fields inherited from class cgl.narada.transport.udp.UDPLinkFactory |
|---|
links, transportHandler, udpListenerSocket, udppinghandler, udpReceiverThread |
| Constructor Summary | |
|---|---|
UP2PLinkFactory()
|
|
| Method Summary | |
|---|---|
Link |
createLink(Properties linkProperties)
Create a communication link based on the properties that have been specified. |
void |
dispose()
This method is used to garbage collect any resources associated with the link factory |
String |
getManagedLinksType()
Return the type of all the links created/managed by this factory |
void |
handleP2P_CONN_REQ(InetAddress remoteAddress,
int remotePort,
String magic)
This handles the connection request from the destination peer. |
void |
handleP2PConnectionRequest(byte[] data)
This handles the P2P connection request that gets forwarded by the Relay server. |
void |
handleP2PConnectionResponse(byte[] data)
|
void |
handleRegisterPeerResponse(byte[] data)
|
boolean |
loadLinkFactoryServices()
Starts communication services. |
static void |
main(String[] args)
|
void |
setLinkFactoryProperties(Properties factoryProperties)
|
| Methods inherited from class cgl.narada.transport.udp.UDPLinkFactory |
|---|
canManageLinkMigrationOfType, getCurrentLink, getTransportHandler, handleInboundUDPLinkRequest, manageLinkMigration, reportLinkLoss, setLinkStatusInterval, setTransportHandler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface cgl.narada.transport.LinkFactory |
|---|
canManageLinkMigrationOfType, manageLinkMigration, setLinkStatusInterval, setTransportHandler |
| Constructor Detail |
|---|
public UP2PLinkFactory()
| Method Detail |
|---|
public void setLinkFactoryProperties(Properties factoryProperties)
setLinkFactoryProperties in interface LinkFactorysetLinkFactoryProperties in class UDPLinkFactorypublic String getManagedLinksType()
getManagedLinksType in interface LinkFactorygetManagedLinksType in class UDPLinkFactorypublic Link createLink(Properties linkProperties) throws TransportException
createLink in interface LinkFactorycreateLink in class UDPLinkFactoryTransportExceptionpublic void dispose()
dispose in interface LinkFactorydispose in class UDPLinkFactory
public boolean loadLinkFactoryServices()
throws TransportException
loadLinkFactoryServices in interface LinkFactoryloadLinkFactoryServices in class UDPLinkFactoryTransportExceptionpublic void handleP2P_CONN_REQ(InetAddress remoteAddress, int remotePort, String magic)
remoteAddress - remotePort - magic - public void handleP2PConnectionResponse(byte[] data)
public void handleRegisterPeerResponse(byte[] data)
public void handleP2PConnectionRequest(byte[] data)
data - public static void main(String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||