updated with neccessary changes (#1709)

This commit is contained in:
Subhrodip Mohanta
2021-05-01 23:52:35 +05:30
committed by GitHub
parent 41b1462eed
commit 31890f67e6
4 changed files with 16 additions and 15 deletions

View File

@ -131,9 +131,10 @@ public class App {
* log requests.
*/
reactor
.registerChannel(tcpChannel(6666, loggingHandler))
.registerChannel(tcpChannel(6667, loggingHandler))
.registerChannel(udpChannel(6668, loggingHandler))
.registerChannel(tcpChannel(16666, loggingHandler))
.registerChannel(tcpChannel(16667, loggingHandler))
.registerChannel(udpChannel(16668, loggingHandler))
.registerChannel(udpChannel(16669, loggingHandler))
.start();
}

View File

@ -63,10 +63,10 @@ public class AppClient {
*/
public void start() throws IOException {
LOGGER.info("Starting logging clients");
service.execute(new TcpLoggingClient("Client 1", 6666));
service.execute(new TcpLoggingClient("Client 2", 6667));
service.execute(new UdpLoggingClient("Client 3", 6668));
service.execute(new UdpLoggingClient("Client 4", 6668));
service.execute(new TcpLoggingClient("Client 1", 16666));
service.execute(new TcpLoggingClient("Client 2", 16667));
service.execute(new UdpLoggingClient("Client 3", 16668));
service.execute(new UdpLoggingClient("Client 4", 16669));
}
/**
@ -114,7 +114,7 @@ public class AppClient {
@Override
public void run() {
try (Socket socket = new Socket(InetAddress.getLocalHost(), serverPort)) {
try (var socket = new Socket(InetAddress.getLocalHost(), serverPort)) {
var outputStream = socket.getOutputStream();
var writer = new PrintWriter(outputStream);
sendLogRequests(writer, socket.getInputStream());