Permalink
Browse files

Fix some issues with node address

  • Loading branch information...
pksunkara committed Sep 16, 2011
1 parent 764008b commit 0e3a387e1940ab6903532d48920b3b303069962f
Showing with 5 additions and 5 deletions.
  1. +1 −1 LamportClock/Pentagon.java
  2. +4 −4 LamportClock/Ranger.java
@@ -43,7 +43,7 @@ private static void report(String msg) throws Exception {
public Client(Socket client) throws Exception {
this.client = client;
- host = client.getInetAddress().getHostName();
+ host = client.getInetAddress().getHostAddress();
in = new ObjectInputStream(client.getInputStream());
out = new ObjectOutputStream(client.getOutputStream());
}
View
@@ -18,17 +18,17 @@
private static Request requestQueue[] = new Request[3];
public static void main(String[] args) throws Exception {
- if(args.length!=2) {
- System.out.println("Usage: Ranger <codename> <port>");
+ if(args.length!=3) {
+ System.out.println("Usage: Ranger <codename> <host> <port>");
System.exit(1);
}
nodeName = args[0];
- port = args[1];
+ port = args[2];
clock = new Clock();
serverThread = new ServerThread(port);
- pentagonSocket = new Socket("localhost", 5000);
+ pentagonSocket = new Socket(args[1], 5000);
pentagonOutput = new ObjectOutputStream(pentagonSocket.getOutputStream());
pentagonInput = new ObjectInputStream(pentagonSocket.getInputStream());

0 comments on commit 0e3a387

Please sign in to comment.