com.aelitis.azureus.core.networkmanager.impl.udp
Class UDPConnectionSet
java.lang.Object
com.aelitis.azureus.core.networkmanager.impl.udp.UDPConnectionSet
public class UDPConnectionSet
- extends java.lang.Object
Method Summary |
protected void |
add(UDPConnection connection)
|
protected int |
bytesToInt(byte[] bytes,
int offset)
|
protected long |
bytesToLong(byte[] bytes)
|
protected long |
bytesToLong(byte[] bytes,
int offset)
|
protected boolean |
canWrite(UDPConnection connection)
|
protected int |
cipherInt(RC4Engine cipher,
int i)
|
void |
close(UDPConnection connection,
java.lang.String reason)
|
protected void |
dumpState()
|
protected void |
failed(java.lang.Throwable e)
|
void |
failed(UDPConnection connection,
java.lang.Throwable reason)
|
protected int |
getExplicitAckTicks()
|
protected java.lang.String |
getKey()
|
protected java.lang.String |
getName()
|
protected java.net.InetSocketAddress |
getRemoteAddress()
|
protected UDPPacket |
getRetransmitPacket()
|
protected int |
getRetransmitTicks()
|
protected int |
getRetransmitTicks(int resend_count)
|
protected UDPSelector |
getSelector()
|
protected boolean |
hasFailed()
|
protected boolean |
idleLimitExceeded()
|
protected byte[] |
intToBytes(int i)
|
protected void |
logStats()
|
protected void |
poll()
|
void |
receive(byte[] initial_data,
int initial_data_length)
|
protected void |
receiveAckCommand(java.nio.ByteBuffer buffer)
|
protected void |
receiveCloseCommand(java.nio.ByteBuffer buffer)
|
protected void |
receiveCrypto(java.nio.ByteBuffer buffer)
|
protected void |
receiveDataCommand(int sequence,
java.nio.ByteBuffer buffer,
int header_length)
|
protected void |
receiveStatsReply(java.nio.ByteBuffer buffer)
|
protected void |
receiveStatsRequest(java.nio.ByteBuffer buffer)
|
protected boolean |
remoteLastInSequence(int alt_sequence)
|
protected boolean |
remove(UDPConnection connection)
|
protected void |
removed()
|
protected void |
retransmitExpired()
|
protected void |
send(UDPPacket packet)
|
protected void |
sendAckCommand(boolean timer_expired)
|
protected void |
sendCloseCommand(UDPConnection connection)
|
protected int |
sendCrypto(java.nio.ByteBuffer[] buffers,
int offset,
int length)
|
protected int |
sendDataCommand(UDPConnection connection,
java.nio.ByteBuffer[] buffers,
int offset,
int length)
|
protected void |
sendStatsRequest()
|
protected void |
setSecret(UDPConnection connection,
byte[] session_secret)
|
protected void |
startKeepAliveTimer()
|
protected void |
stopKeepAliveTimer()
|
protected void |
timerTick()
|
protected void |
trace(java.lang.String str)
|
protected void |
trace(UDPConnection connection,
java.lang.String str)
|
protected int |
write(UDPConnection connection,
java.nio.ByteBuffer[] buffers,
int offset,
int length)
|
protected int |
writeHeaderEnd(java.nio.ByteBuffer buffer,
boolean randomise_size)
|
protected int[] |
writeHeaderStart(java.nio.ByteBuffer buffer,
byte command,
byte flags)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MIN_WRITE_PAYLOAD
public static final int MIN_WRITE_PAYLOAD
- See Also:
- Constant Field Values
MAX_BUFFERED_PAYLOAD
public static final int MAX_BUFFERED_PAYLOAD
- See Also:
- Constant Field Values
UDPConnectionSet
protected UDPConnectionSet(UDPConnectionManager _manager,
java.lang.String _connection_key,
UDPSelector _selector,
int _local_port,
java.net.InetSocketAddress _remote_address)
getSelector
protected UDPSelector getSelector()
getRemoteAddress
protected java.net.InetSocketAddress getRemoteAddress()
getKey
protected java.lang.String getKey()
add
protected void add(UDPConnection connection)
throws java.io.IOException
- Throws:
java.io.IOException
remove
protected boolean remove(UDPConnection connection)
poll
protected void poll()
setSecret
protected void setSecret(UDPConnection connection,
byte[] session_secret)
timerTick
protected void timerTick()
throws java.io.IOException
- Throws:
java.io.IOException
getRetransmitTicks
protected int getRetransmitTicks()
getExplicitAckTicks
protected int getExplicitAckTicks()
startKeepAliveTimer
protected void startKeepAliveTimer()
stopKeepAliveTimer
protected void stopKeepAliveTimer()
idleLimitExceeded
protected boolean idleLimitExceeded()
getRetransmitPacket
protected UDPPacket getRetransmitPacket()
getRetransmitTicks
protected int getRetransmitTicks(int resend_count)
retransmitExpired
protected void retransmitExpired()
throws java.io.IOException
- Throws:
java.io.IOException
remoteLastInSequence
protected boolean remoteLastInSequence(int alt_sequence)
dumpState
protected void dumpState()
send
protected void send(UDPPacket packet)
throws java.io.IOException
- Throws:
java.io.IOException
receive
public void receive(byte[] initial_data,
int initial_data_length)
throws java.io.IOException
- Throws:
java.io.IOException
sendCrypto
protected int sendCrypto(java.nio.ByteBuffer[] buffers,
int offset,
int length)
throws java.io.IOException
- Throws:
java.io.IOException
receiveCrypto
protected void receiveCrypto(java.nio.ByteBuffer buffer)
throws java.io.IOException
- Throws:
java.io.IOException
sendDataCommand
protected int sendDataCommand(UDPConnection connection,
java.nio.ByteBuffer[] buffers,
int offset,
int length)
throws java.io.IOException
- Throws:
java.io.IOException
receiveDataCommand
protected void receiveDataCommand(int sequence,
java.nio.ByteBuffer buffer,
int header_length)
throws java.io.IOException
- Throws:
java.io.IOException
sendAckCommand
protected void sendAckCommand(boolean timer_expired)
throws java.io.IOException
- Throws:
java.io.IOException
receiveAckCommand
protected void receiveAckCommand(java.nio.ByteBuffer buffer)
throws java.io.IOException
- Throws:
java.io.IOException
sendStatsRequest
protected void sendStatsRequest()
throws java.io.IOException
- Throws:
java.io.IOException
receiveStatsRequest
protected void receiveStatsRequest(java.nio.ByteBuffer buffer)
throws java.io.IOException
- Throws:
java.io.IOException
receiveStatsReply
protected void receiveStatsReply(java.nio.ByteBuffer buffer)
throws java.io.IOException
- Throws:
java.io.IOException
sendCloseCommand
protected void sendCloseCommand(UDPConnection connection)
throws java.io.IOException
- Throws:
java.io.IOException
receiveCloseCommand
protected void receiveCloseCommand(java.nio.ByteBuffer buffer)
throws java.io.IOException
- Throws:
java.io.IOException
writeHeaderStart
protected int[] writeHeaderStart(java.nio.ByteBuffer buffer,
byte command,
byte flags)
throws java.io.IOException
- Throws:
java.io.IOException
writeHeaderEnd
protected int writeHeaderEnd(java.nio.ByteBuffer buffer,
boolean randomise_size)
throws java.io.IOException
- Throws:
java.io.IOException
write
protected int write(UDPConnection connection,
java.nio.ByteBuffer[] buffers,
int offset,
int length)
throws java.io.IOException
- Throws:
java.io.IOException
canWrite
protected boolean canWrite(UDPConnection connection)
close
public void close(UDPConnection connection,
java.lang.String reason)
failed
public void failed(UDPConnection connection,
java.lang.Throwable reason)
failed
protected void failed(java.lang.Throwable e)
hasFailed
protected boolean hasFailed()
removed
protected void removed()
cipherInt
protected int cipherInt(RC4Engine cipher,
int i)
bytesToInt
protected int bytesToInt(byte[] bytes,
int offset)
intToBytes
protected byte[] intToBytes(int i)
bytesToLong
protected long bytesToLong(byte[] bytes)
bytesToLong
protected long bytesToLong(byte[] bytes,
int offset)
getName
protected java.lang.String getName()
logStats
protected void logStats()
trace
protected void trace(java.lang.String str)
trace
protected void trace(UDPConnection connection,
java.lang.String str)