use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class EventClient method start.
public void start() throws IOException, InterruptedException {
ChannelService mgr = ChannelServiceFactory.createDefaultChannelMgr("EventServer");
mgr.start();
SSLEngineFactory sslFactory = new MockSSLEngineFactory();
Settings h = new Settings(sslFactory, null);
TCPChannel channel = mgr.createTCPChannel("SvrChan", h);
InetAddress addr = InetAddress.getByName("192.168.1.102");
InetSocketAddress sockAddr = new InetSocketAddress(addr, 801);
log.info("Connecting to server=" + sockAddr);
channel.oldConnect(sockAddr, this);
}
use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class EventServer method start.
public void start() throws IOException, InterruptedException {
log.info("Attempting to start server");
ChannelService mgr = ChannelServiceFactory.createDefaultChannelMgr("EventServer");
mgr.start();
SSLEngineFactory sslFactory = new MockSSLEngineFactory();
Settings h = new Settings(sslFactory, null);
TCPServerChannel svrChannel = mgr.createTCPServerChannel("SvrChan", h);
InetAddress addr = InetAddress.getByName("192.168.1.101");
InetSocketAddress sockAddr = new InetSocketAddress(addr, 801);
log.info("binding");
svrChannel.bind(sockAddr);
log.info("bound to=" + svrChannel.getLocalAddress());
svrChannel.registerServerSocketChannel(this);
log.info(svrChannel + "Server started");
}
use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class PerfTestZSecure method getServerChanMgr.
@Override
protected ChannelService getServerChanMgr() {
Map<String, Object> p = new HashMap<String, Object>();
p.put(ChannelManagerOld.KEY_ID, "echoServer");
p.put(ChannelManagerOld.KEY_BUFFER_FACTORY, getBufFactory());
p.put(ChannelManagerOld.KEY_EXECUTORSVC_FACTORY, serverExecFactory);
ChannelService svcChanMgr = secureFactory.createChannelManager(p);
return svcChanMgr;
}
use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class PerfTestZSecure method getClientChanMgr.
@Override
protected ChannelService getClientChanMgr() {
Map<String, Object> p = new HashMap<String, Object>();
p.put(ChannelManagerOld.KEY_ID, "client");
p.put(ChannelManagerOld.KEY_BUFFER_FACTORY, getBufFactory());
p.put(ChannelManagerOld.KEY_EXECUTORSVC_FACTORY, clientExecFactory);
ChannelService chanMgr = secureFactory.createChannelManager(p);
return chanMgr;
}
use of org.webpieces.nio.api.deprecated.ChannelService in project webpieces by deanhiller.
the class ZPerformanceSuper method setUp.
protected void setUp() throws Exception {
HandlerForTests.setupLogging();
LoggerFactory.getLogger("").setLevel(Level.INFO);
//and started back up cleanly.....
if (chanMgr == null) {
chanMgr = getClientChanMgr();
}
if (echoServer == null) {
ChannelService svrChanMgr = getServerChanMgr();
echoServer = new EchoServer(svrChanMgr, getServerFactoryHolder());
}
chanMgr.start();
svrAddr = echoServer.start();
//this is to test EchoServer on a different machine...
// InetAddress tmp = InetAddress.getByName("192.168.1.102");
// svrAddr = new InetSocketAddress(tmp, 501);
log.trace("server port =" + svrAddr);
//loopBack = InetAddress.getByName("127.0.0.1");
//loopBackAnyPort = new InetSocketAddress(loopBack, 0);
mockHandler = MockObjectFactory.createMock(DataListener.class);
mockHandler.setDefaultBehavior("incomingData", new CloneByteBuffer());
mockConnect = MockObjectFactory.createMock(ConnectionCallback.class);
mockConnectOp = MockObjectFactory.createMock(OperationCallback.class);
}
Aggregations