Skip to content
Snippets Groups Projects
Commit 6d452194 authored by Martin Hustoles's avatar Martin Hustoles
Browse files

adfasgfedas

parent 4c8c9673
No related branches found
No related tags found
No related merge requests found
package cp;
public class CPCookie {
}
......@@ -21,7 +21,7 @@ public class CPProtocol extends Protocol {
private PhyConfiguration PhyConfig;
private PhyProtocol PhyProto;
boolean isClient;
HashMap<PhyConfiguration, String> cookieMap;
HashMap<PhyConfiguration, Integer> cookieMap;
Random rnd;
// Constructor for clients
......@@ -93,7 +93,6 @@ public class CPProtocol extends Protocol {
//Discard Message
}
/*
//discard message, if not instance of CPCommandMessage
if(!(in instanceof CPCommandResponseMessage)){
continue;
......@@ -102,7 +101,7 @@ public class CPProtocol extends Protocol {
//compare the id from the received message and the earlier sent message
if(((CPCommandResponseMessage) in).getMessageId() != this.id){
continue;
}*/
}
receving = false;
}
......@@ -116,7 +115,7 @@ public class CPProtocol extends Protocol {
return;
}
cookieMap.put(config, cookie);
cookieMap.put(config, config.hashCode(cookie));
}
......
package cp;
public class CPStatusCommand extends CPMsg{
}
......@@ -2,6 +2,7 @@ package phy;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Objects;
import core.Configuration;
import core.Protocol;
......@@ -30,11 +31,10 @@ public class PhyConfiguration extends Configuration{
public Protocol.proto_id getPid() {return this.pid;}
public boolean equals(PhyConfiguration otherConfig){
public boolean equals(PhyConfiguration otherConfig ){
return false;
}
public int hashCode(){
return 0;
public int hashCode(String cookie){
return System.identityHashCode(cookie);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment