From 35bce6dae745b6a3f45bc776ab6d2903ae4a3310 Mon Sep 17 00:00:00 2001 From: CyB3RC0nN0R Date: Fri, 3 Jan 2020 17:55:37 +0200 Subject: [PATCH] Added getters for SocketAcceptor and SocketProcessor to Server --- src/main/java/com/jenkov/nioserver/Server.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/jenkov/nioserver/Server.java b/src/main/java/com/jenkov/nioserver/Server.java index 2926384..2eb9e71 100644 --- a/src/main/java/com/jenkov/nioserver/Server.java +++ b/src/main/java/com/jenkov/nioserver/Server.java @@ -13,7 +13,7 @@ import java.util.concurrent.ArrayBlockingQueue; */ public class Server { - private SocketAcceptor socketAccepter; + private SocketAcceptor socketAcceptor; private SocketProcessor socketProcessor; private int tcpPort; @@ -30,17 +30,21 @@ public class Server { Queue socketQueue = new ArrayBlockingQueue<>(1024); // TODO: move 1024 to ServerConfig - socketAccepter = new SocketAcceptor(tcpPort, socketQueue); + socketAcceptor = new SocketAcceptor(tcpPort, socketQueue); MessageBuffer readBuffer = new MessageBuffer(); MessageBuffer writeBuffer = new MessageBuffer(); socketProcessor = new SocketProcessor(socketQueue, readBuffer, writeBuffer, this.messageReaderFactory, this.messageProcessor); - Thread accepterThread = new Thread(socketAccepter); + Thread accepterThread = new Thread(socketAcceptor); Thread processorThread = new Thread(socketProcessor); accepterThread.start(); processorThread.start(); } + + public SocketAcceptor getSocketAcceptor() { return socketAcceptor; } + + public SocketProcessor getSocketProcessor() { return socketProcessor; } } \ No newline at end of file