|
Project JXTA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jxta.impl.endpoint.tcp.TcpTransport
public class TcpTransport
This class implements the TCP Transport Protocol
MessageTransport,
MessageSender,
MessageReceiver,
EndpointService,
JXTA Protocols Specification : Standard JXTA Transport Bindings| Nested Class Summary | |
|---|---|
(package private) static class |
TcpTransport.Watcher
TimerTask used to watch over connections. |
| Field Summary | |
|---|---|
(package private) static int |
ChunkSize
The number of bytes that we write to/read from a socket in a single write/read call. |
(package private) static int |
connectionTimeOut
The amount of time we wait for a connection to be established (effective with jdk 1.4 only). |
(package private) Timer |
connectionWatchTimer
|
(package private) EndpointService |
endpoint
|
(package private) PeerGroup |
group
|
(package private) static int |
LingerDelay
The amount of time the socket "lingers" after we close it locally. |
(package private) List |
LongCycle
|
(package private) static int |
LongTimeout
Amount of time our input stream will wait for any kind of progress on input before declaring that input has stalled. |
(package private) static int |
MaxAcceptCnxBacklog
|
(package private) ThreadGroup |
myThreadGroup
This is the thread group into which we will place all of the threads we create. |
(package private) static int |
RecvBufferSize
The buffer size that we instruct TCP to use for incoming data. |
(package private) static int |
SendBufferSize
The size of the buffer that we use to store message data being sent. |
(package private) List |
ShortCycle
|
(package private) static int |
ShortTimeout
Amount of time our input stream will wait for any kind of progress on input before declaring that input has stalled. |
(package private) InetAddress |
usingInterface
|
| Fields inherited from interface net.jxta.platform.Module |
|---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_OK |
| Constructor Summary | |
|---|---|
TcpTransport()
Construct a new TCPTransport instance |
|
| Method Summary | |
|---|---|
boolean |
allowsRouting()
|
boolean |
equals(Object target)
|
EndpointService |
getEndpointService()
|
Messenger |
getMessenger(EndpointAddress dst,
Object hintIgnored)
|
(package private) TransportBindingMeter |
getMulticastTransportBindingMeter(EndpointAddress destinationAddress)
|
String |
getProtocolName()
|
EndpointAddress |
getPublicAddress()
|
Iterator |
getPublicAddresses()
|
(package private) int |
getRestrictionPort()
|
(package private) TransportBindingMeter |
getUnicastTransportBindingMeter(PeerID peerID,
EndpointAddress destinationAddress)
|
int |
hashCode()
|
void |
init(PeerGroup g,
ID assignedID,
Advertisement impl)
Initialization of the TcpTransport (called by Platform) |
boolean |
isConnectionOriented()
|
boolean |
isPropagateEnabled()
(@inheritdoc} |
boolean |
isPropagationSupported()
(@inheritdoc} |
(package private) void |
messengerReadyEvent(Messenger newMessenger,
EndpointAddress connAddr)
|
boolean |
ping(EndpointAddress addr)
Ping a remote host. |
void |
processMulticast(byte[] buffer,
int size)
Handle a byte buffer from a multi-cast. |
void |
propagate(Message message,
String pName,
String pParams,
String prunePeer)
Propagates a TransportMessage on this EndpointProtocol Synchronizing to not allow concurrent IP multicast: this naturally bounds the usage of ip-multicast boolean be linear and not exponantial. |
void |
run()
Handles incoming multicasts. |
int |
startApp(String[] arg)
|
void |
stopApp()
|
Object |
transportControl(Object operation,
Object Value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final int SendBufferSize
static final int ChunkSize
static final int RecvBufferSize
static final int LongTimeout
static final int ShortTimeout
static final int LingerDelay
static int connectionTimeOut
static final int MaxAcceptCnxBacklog
List ShortCycle
List LongCycle
InetAddress usingInterface
PeerGroup group
EndpointService endpoint
ThreadGroup myThreadGroup
final Timer connectionWatchTimer
| Constructor Detail |
|---|
public TcpTransport()
| Method Detail |
|---|
public boolean equals(Object target)
equals in class Objectpublic int hashCode()
hashCode in class Object
public void init(PeerGroup g,
ID assignedID,
Advertisement impl)
throws PeerGroupException
init in interface ModulePeerGroupExceptionpublic int startApp(String[] arg)
startApp in interface Modulepublic void stopApp()
stopApp in interface Modulepublic String getProtocolName()
getProtocolName in interface MessageTransportpublic EndpointAddress getPublicAddress()
getPublicAddress in interface MessageSenderpublic EndpointService getEndpointService()
getEndpointService in interface MessageTransport
public Object transportControl(Object operation,
Object Value)
transportControl in interface MessageTransportpublic Iterator getPublicAddresses()
getPublicAddresses in interface MessageReceiverpublic boolean isConnectionOriented()
isConnectionOriented in interface MessageSenderpublic boolean allowsRouting()
allowsRouting in interface MessageSender
public Messenger getMessenger(EndpointAddress dst,
Object hintIgnored)
getMessenger in interface MessageSenderpublic void run()
run in interface Runnable
public void processMulticast(byte[] buffer,
int size)
buffer - the buffer to process.public boolean isPropagateEnabled()
isPropagateEnabled in interface MessageSenderpublic boolean isPropagationSupported()
isPropagationSupported in interface MessageSender
public void propagate(Message message,
String pName,
String pParams,
String prunePeer)
throws IOException
propagate in interface MessageSendermessage - the TransportMessage to be propagatedpName - the name of a servicepParams - parameters for this message.prunePeer - (ignored)
IOException - thrown if the message could not be sent for some reason.public boolean ping(EndpointAddress addr)
ping in interface MessageSenderaddr - the endpoint addresss to ping
int getRestrictionPort()
TransportBindingMeter getUnicastTransportBindingMeter(PeerID peerID,
EndpointAddress destinationAddress)
TransportBindingMeter getMulticastTransportBindingMeter(EndpointAddress destinationAddress)
void messengerReadyEvent(Messenger newMessenger,
EndpointAddress connAddr)
|
JXTA J2SE | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||