Up Previous Next

First off the server must list its new method in its public interface:
public interface ServerInterface {
  public int register(ClientInterface client);
} 
Then the server must implement it:

public class Server implements ServerInterface {
  public int register(ClientInterface client) {
    size++;
    return size; 
  } 
  int size = -1; 
}
We might want to synchronize the registration method, but let's do that later.

Furthermore, the client interface needs to be provided:

public interface ClientInterface {
  
}
We can run the setup again, now. (If we do it, this would be test no. 2.)

The clients register, get different id numbers and report them.


Up Previous Next