~smaioli/azureus/ubuntu-experimental

« back to all changes in this revision

Viewing changes to com/aelitis/azureus/core/dht/transport/udp/impl/DHTUDPPacketRequestFindNode.java

MergedĀ VuzeĀ 4.0.0.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import java.io.DataOutputStream;
27
27
import java.io.IOException;
28
28
 
 
29
import com.aelitis.azureus.core.dht.transport.udp.DHTTransportUDP;
29
30
import com.aelitis.azureus.core.dht.transport.udp.impl.packethandler.DHTUDPPacketNetworkHandler;
30
31
 
31
32
 
40
41
{
41
42
        private byte[]          id;
42
43
        
 
44
        private int                     node_status;
 
45
        private int                     estimated_dht_size;
 
46
        
43
47
        public
44
48
        DHTUDPPacketRequestFindNode(
45
49
                DHTTransportUDPImpl                             _transport,
63
67
                
64
68
                id = DHTUDPUtils.deserialiseByteArray( is, 64 );
65
69
                
 
70
                if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_MORE_NODE_STATUS ){
 
71
 
 
72
                        node_status             = is.readInt();
 
73
                        estimated_dht_size      = is.readInt();
 
74
                }
 
75
                
66
76
                super.postDeserialise(is);
67
77
        }
68
78
        
76
86
                
77
87
                DHTUDPUtils.serialiseByteArray( os, id, 64 );
78
88
                
 
89
                if ( getProtocolVersion() >= DHTTransportUDP.PROTOCOL_VERSION_MORE_NODE_STATUS ){
 
90
 
 
91
                         os.writeInt( node_status );
 
92
                        
 
93
                         os.writeInt( estimated_dht_size );
 
94
                }
 
95
                
79
96
                super.postSerialise( os );
80
97
        }
81
98
        
92
109
                return( id );
93
110
        }
94
111
        
 
112
        protected void
 
113
        setNodeStatus(
 
114
                int             ns )
 
115
        {
 
116
                node_status     = ns;
 
117
        }
 
118
        
 
119
        protected int
 
120
        getNodeStatus()
 
121
        {
 
122
                return( node_status );
 
123
        }
 
124
                
 
125
        protected void
 
126
        setEstimatedDHTSize(
 
127
                int     s )
 
128
        {
 
129
                estimated_dht_size      = s;
 
130
        }
 
131
        
 
132
        protected int
 
133
        getEstimatedDHTSize()
 
134
        {
 
135
                return( estimated_dht_size );
 
136
        }
 
137
        
95
138
        public String
96
139
        getString()
97
140
        {