final String scheme = u.getScheme();
if (!scheme.equalsIgnoreCase("http"))
throw new IllegalArgumentException("The URI scheme, of the URI " + u +
", must be equal (ignoring case) to 'http'");
final SelectorThread selectorThread = new SelectorThread();
selectorThread.setAlgorithmClassName(StaticStreamAlgorithm.class.getName());
final int port = (u.getPort() == -1) ? 80 : u.getPort();
selectorThread.setPort(port);
selectorThread.setAdapter(adapter);
try {
selectorThread.listen();
} catch (InstantiationException e) {
IOException _e = new IOException();
_e.initCause(e);
throw _e;
}