code: private static boolean checkValidity(ClientSocket client, byte from, StateConnection expected)
      {
          return from >= 0 && client.getState() == expected;
      }
docs: Check if the client is in a valid state.
  
  @param client The client to test.
  @param from The client id.
  @param expected The expected client state.
  @return <code>true</code> if valid, <code>false</code> else.