本文整理汇总了Java中org.glassfish.grizzly.PortRange类的典型用法代码示例。如果您正苦于以下问题:Java PortRange类的具体用法?Java PortRange怎么用?Java PortRange使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PortRange类属于org.glassfish.grizzly包,在下文中一共展示了PortRange类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.glassfish.grizzly.PortRange; //导入依赖的package包/类
@PostConstruct
public void start() {
server = new HttpServer();
final NetworkListener listener = new NetworkListener("grizzly", "localhost", new PortRange(port));
server.addListener(listener);
try {
server.start();
logger.info("Test server running on {}", port);
} catch (final Throwable e) {
logger.error("Error with test server", e);
}
}
示例2: startWebserver
import org.glassfish.grizzly.PortRange; //导入依赖的package包/类
@BeforeClass
public static void startWebserver() throws IOException {
MimeType.add("mp4", "video/mp4");
server =
HttpServer.createSimpleServer(
Samples.TEST_PREFIX, "127.0.0.1", new PortRange(10000, 60000));
server.start();
LOG.info("Started server at {}", getWebserverRoot());
}
示例3: initServer
import org.glassfish.grizzly.PortRange; //导入依赖的package包/类
final HttpServer initServer(Bck2Brwsr.Resources... extraResources) throws IOException {
xRes.addAll(Arrays.asList(extraResources));
HttpServer s = HttpServer.createSimpleServer(".", new PortRange(8080, 65535));
final ServerConfiguration conf = s.getServerConfiguration();
conf.addHttpHandler(new VM(resources), "/bck2brwsr.js");
conf.addHttpHandler(new VMInit(), "/vm.js");
conf.addHttpHandler(new Classes(resources), "/classes/");
return s;
}