use of org.apache.catalina.tribes.membership.MemberImpl in project tomcat by apache.
the class SocketNioReceive method main.
public static void main(String[] args) throws Exception {
Member mbr = new MemberImpl("localhost", 9999, 0);
ChannelData data = new ChannelData();
data.setAddress(mbr);
byte[] buf = new byte[8192 * 4];
data.setMessage(new XByteBuffer(buf, false));
buf = XByteBuffer.createDataPackage(data);
len = buf.length;
NioReceiver receiver = new NioReceiver();
receiver.setPort(9999);
receiver.setHost("localhost");
MyList list = new MyList();
receiver.setMessageListener(list);
receiver.start();
System.out.println("Listening on 9999");
while (true) {
try {
synchronized (mutex) {
mutex.wait(5000);
if (start != 0) {
System.out.println("Throughput " + df.format(mb / seconds) + " MB/seconds, messages " + count + " accepts " + accept + ", total " + mb + " MB.");
}
}
} catch (Throwable x) {
x.printStackTrace();
}
}
}
Aggregations