* of the neighbour that will receive the list.
*/
public void sendNeighborsListToNeigh(int port , int neighbour) {
char[] resp = null;
SocketAddress neighbourAddress = new InetSocketAddress("localhost",
port);
resp = new String("DELET " + this.port).toCharArray();
DatagramPacket answer = null;
try {
// answer = new DatagramPacket(resp, resp.length, neighbourAddress);
// this.socket.send(answer);
channel.send(Charset.forName("ascii").encode(
CharBuffer.wrap(resp)), neighbourAddress);
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(port != neighbour){
resp = new String("ADD_PORT " + neighbour).toCharArray();
try {
channel.send(Charset.forName("ascii").encode(
CharBuffer.wrap(resp)), neighbourAddress);
//this.socket.send(answer);
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
resp = new String("ADD_PORT " + port).toCharArray();
SocketAddress neighbourAddress1 = new InetSocketAddress("localhost",
neighbour);
try {
channel.send(Charset.forName("ascii").encode(