当前位置: 首页>>代码示例>>Java>>正文


Java ThreadedSocketExecuter类代码示例

本文整理汇总了Java中org.threadly.litesockets.ThreadedSocketExecuter的典型用法代码示例。如果您正苦于以下问题:Java ThreadedSocketExecuter类的具体用法?Java ThreadedSocketExecuter怎么用?Java ThreadedSocketExecuter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ThreadedSocketExecuter类属于org.threadly.litesockets包,在下文中一共展示了ThreadedSocketExecuter类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FakeHTTPStreamingServer

import org.threadly.litesockets.ThreadedSocketExecuter; //导入依赖的package包/类
public FakeHTTPStreamingServer(int port, HTTPResponse hr, String sendBack, int kiloToSend, boolean doSSL, boolean chunk) throws IOException {
  this.port = port;
  this.hr = hr;
  this.chunked = chunk;
  kToSend = kiloToSend;
  if(doSSL) {
    doSSLCrap();
  }
  PS = new PriorityScheduler(5);
  SEB = new ThreadedSocketExecuter(PS);
  SEB.start();
  server = new HTTPServer(SEB, "localhost", port, sslCtx);
  server.addHandler(this);
  server.start();
  this.sendBack.add(ByteBuffer.wrap(sendBack.getBytes()));
}
 
开发者ID:threadly,项目名称:litesockets-http,代码行数:17,代码来源:FakeHTTPStreamingServer.java

示例2: start

import org.threadly.litesockets.ThreadedSocketExecuter; //导入依赖的package包/类
@Before
public void start() throws IOException {
  port = PortUtils.findTCPPort();
  PS = new PriorityScheduler(2);
  TSE = new ThreadedSocketExecuter(PS);
  TSE.start();
  httpServer = TSE.createTCPServer("localhost", port);
  httpServer.start();
  httpServer.start();
}
 
开发者ID:threadly,项目名称:litesockets-http,代码行数:11,代码来源:WebSocketClientTest.java

示例3: TestHTTPServer

import org.threadly.litesockets.ThreadedSocketExecuter; //导入依赖的package包/类
public TestHTTPServer(int port, HTTPResponse hr, String sendBack, boolean doSSL, boolean closeOnSend) throws IOException {
  if(doSSL) {
    doSSLCrap();
  } 
  this.hr = hr;
  this.port = port;
  PS = new PriorityScheduler(5);
  SEB = new ThreadedSocketExecuter(PS);
  SEB.start();
  server = new HTTPServer(SEB, "localhost", port, sslCtx);
  server.addHandler(this);
  server.start();
  this.sendBack.add(ByteBuffer.wrap(sendBack.getBytes()));
  this.closeOnSend = closeOnSend;
}
 
开发者ID:threadly,项目名称:litesockets-http,代码行数:16,代码来源:TestHTTPServer.java

示例4: start

import org.threadly.litesockets.ThreadedSocketExecuter; //导入依赖的package包/类
@Before
public void start() throws IOException {
  PS = new PriorityScheduler(5);
  SE = new ThreadedSocketExecuter(PS);
  SE.start();
  serverFC = new FakeUDPServerClient(SE);
  server = SE.createUDPServer("127.0.0.1", port);
  server.setClientAcceptor(serverFC);
  server.start();
}
 
开发者ID:threadly,项目名称:litesockets,代码行数:11,代码来源:UDPTest.java

示例5: start

import org.threadly.litesockets.ThreadedSocketExecuter; //导入依赖的package包/类
@Before
public void start() throws IOException {
  port = PortUtils.findTCPPort();
  PS = new PriorityScheduler(5);
  SE = new ThreadedSocketExecuter(PS);
  SE.start();
  clientHandler = new FakeTCPServerClient();
  pServer = new ProfileServer(SE, "localhost", port, 10);
}
 
开发者ID:threadly,项目名称:litesockets,代码行数:10,代码来源:ProfileServerTest.java

示例6: start

import org.threadly.litesockets.ThreadedSocketExecuter; //导入依赖的package包/类
@Before
public void start() throws IOException {
  port = PortUtils.findTCPPort();
  PS = new PriorityScheduler(5);
  SE = new ThreadedSocketExecuter(PS);
  SE.start();
  serverFC = new FakeTCPServerClient();
  server = SE.createTCPServer("localhost", port);
  server.setClientAcceptor(serverFC);
  server.addCloseListener(serverFC);
  server.start();
}
 
开发者ID:threadly,项目名称:litesockets,代码行数:13,代码来源:TCPTests.java

示例7: closedServerStartTest

import org.threadly.litesockets.ThreadedSocketExecuter; //导入依赖的package包/类
@Test
public void closedServerStartTest() throws Exception {
  server.close();
  SE.startListening(server);
  SocketExecuter SE2 = new ThreadedSocketExecuter();
  SE2.start();
  TCPServer server2 = SE2.createTCPServer("localhost", port);
  SE.startListening(server2);
  server2.close();
  SE2.stopIfRunning();
  
}
 
开发者ID:threadly,项目名称:litesockets,代码行数:13,代码来源:TCPTests.java

示例8: start

import org.threadly.litesockets.ThreadedSocketExecuter; //导入依赖的package包/类
@Before
public void start() throws Exception {
  PS = new PriorityScheduler(5);
  SE = new ThreadedSocketExecuter(PS);
  SE.start();
  port = PortUtils.findTCPPort();
  KS = KeyStore.getInstance(KeyStore.getDefaultType());

  File filename = new File(ClassLoader.getSystemClassLoader().getResource("test.pem").getFile());

  kmf = SSLUtils.generateKeyStoreFromPEM(filename, filename);    
  sslCtx = SSLContext.getInstance("SSL");
  sslCtx.init(kmf.getKeyManagers(), myTMs, null);
  serverFC = new FakeTCPServerClient();
}
 
开发者ID:threadly,项目名称:litesockets,代码行数:16,代码来源:SSLTests.java

示例9: start

import org.threadly.litesockets.ThreadedSocketExecuter; //导入依赖的package包/类
@Before
public void start() {
  PS = new PriorityScheduler(5);
  SEI = new ThreadedSocketExecuter(PS);
  SEI.start();
}
 
开发者ID:threadly,项目名称:litesockets-http,代码行数:7,代码来源:HTTPStreamClientTest.java


注:本文中的org.threadly.litesockets.ThreadedSocketExecuter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。