use of com.tvd12.ezyfoxserver.client.EzyTcpClient in project ezyfox-server-example by tvd12.
the class TcpSocketStresstest method main.
public static void main(String[] args) throws Exception {
DefaultClientConfig clientConfig = new DefaultClientConfig();
SocketClientSetup setup = new SocketClientSetup("websocket");
EzyClients clients = EzyClients.getInstance();
new Thread(() -> {
int clientCount = 300;
for (int i = 0; i < clientCount; i++) {
EzyTcpClient client = new EzyTcpClient(clientConfig.get(i));
try {
Thread.sleep(50);
} catch (Exception e) {
e.printStackTrace();
}
setup.setup(client, false);
clients.addClient(client);
client.connect("127.0.0.1", 3005);
}
}).start();
EzyMainEventsLoop mainEventsLoop = new EzyMainEventsLoop();
mainEventsLoop.start(5);
}
use of com.tvd12.ezyfoxserver.client.EzyTcpClient in project ezyfox-server-example by tvd12.
the class UdpSocketStresstest method main.
public static void main(String[] args) throws Exception {
DefaultClientConfig clientConfig = new DefaultClientConfig();
SocketClientSetup setup = new SocketClientSetup("websocket");
EzyClients clients = EzyClients.getInstance();
new Thread(() -> {
int clientCount = 500;
for (int i = 0; i < clientCount; i++) {
EzyTcpClient client = new EzyUTClient(clientConfig.get(i));
try {
Thread.sleep(50);
} catch (Exception e) {
e.printStackTrace();
}
setup.setup(client, true);
clients.addClient(client);
client.connect("127.0.0.1", 3005);
}
}).start();
EzyMainEventsLoop mainEventsLoop = new EzyMainEventsLoop();
mainEventsLoop.start(5);
}
Aggregations