DHTUDPPacketReplyErrorpublic class DHTUDPPacketReplyError extends DHTUDPPacketReply
Fields Summary |
---|
public static final int | ET_UNKNOWN | public static final int | ET_ORIGINATOR_ADDRESS_WRONG | public static final int | ET_KEY_BLOCKED | private int | error_type | private InetSocketAddress | originator_address | private byte[] | key_block_request | private byte[] | key_block_signature |
Constructors Summary |
---|
public DHTUDPPacketReplyError(DHTTransportUDPImpl transport, int trans_id, long conn_id, com.aelitis.azureus.core.dht.transport.DHTTransportContact local_contact, com.aelitis.azureus.core.dht.transport.DHTTransportContact remote_contact)
super( transport, DHTUDPPacketHelper.ACT_REPLY_ERROR, trans_id, conn_id, local_contact, remote_contact );
| protected DHTUDPPacketReplyError(com.aelitis.azureus.core.dht.transport.udp.impl.packethandler.DHTUDPPacketNetworkHandler network_handler, DataInputStream is, int trans_id)
super( network_handler, is, DHTUDPPacketHelper.ACT_REPLY_ERROR, trans_id );
error_type = is.readInt();
if ( error_type == ET_ORIGINATOR_ADDRESS_WRONG ){
originator_address = DHTUDPUtils.deserialiseAddress( is );
}else if( error_type == ET_KEY_BLOCKED ){
key_block_request = DHTUDPUtils.deserialiseByteArray( is, 255 );
key_block_signature = DHTUDPUtils.deserialiseByteArray( is, 65535 );
}
|
Methods Summary |
---|
protected int | getErrorType()
return( error_type );
| protected byte[] | getKeyBlockRequest()
return( key_block_request );
| protected byte[] | getKeyBlockSignature()
return( key_block_signature );
| protected java.net.InetSocketAddress | getOriginatingAddress()
return( originator_address );
| public void | serialise(java.io.DataOutputStream os)
super.serialise(os);
os.writeInt( error_type );
if ( error_type == ET_ORIGINATOR_ADDRESS_WRONG ){
try{
DHTUDPUtils.serialiseAddress( os, originator_address );
}catch( DHTTransportException e ){
Debug.printStackTrace( e );
throw( new IOException( e.getMessage()));
}
}else if( error_type == ET_KEY_BLOCKED ){
DHTUDPUtils.serialiseByteArray( os, key_block_request, 255 );
DHTUDPUtils.serialiseByteArray( os, key_block_signature, 65535 );
}
| protected void | setErrorType(int error)
error_type = error;
| protected void | setKeyBlockDetails(byte[] kbr, byte[] sig)
key_block_request = kbr;
key_block_signature = sig;
| protected void | setOriginatingAddress(java.net.InetSocketAddress a)
originator_address = a;
|
|