/** * Constructor for the <code>SocketWriter</code> object. This is * used to create a writer that can write packets to the socket * in such a way that it write either asynchronously or block * the calling thread until such time as the packets are written. * * @param socket this is the pipeline that this writes to * @param reactor this is the writer used to scheduler writes * @param threshold this is the threshold for asynchronous buffers */ public SocketController(Socket socket, Reactor reactor, int threshold) throws IOException { this.writer = new SocketWriter(socket, threshold); this.flusher = new SocketFlusher(socket, reactor, writer); }
/** * Constructor for the <code>SocketBufferWriter</code> object. This * is used to create a writer that can write buffers to the socket * in such a way that it write either asynchronously or block * the calling thread until such time as the buffers are written. * * @param socket this is the pipeline that this writes to * @param reactor this is the writer used to scheduler writes * @param buffer this is the initial size of the output buffer * @param threshold this is the maximum size of the buffer */ public SocketBufferWriter(Socket socket, Reactor reactor, int buffer, int threshold) throws IOException { this.writer = new SocketBuffer(socket, buffer, threshold); this.flusher = new SocketFlusher(writer, socket, reactor); }
/** * Constructor for the <code>SocketBufferWriter</code> object. This * is used to create a writer that can write buffers to the socket * in such a way that it write either asynchronously or block * the calling thread until such time as the buffers are written. * * @param socket this is the pipeline that this writes to * @param reactor this is the writer used to scheduler writes * @param buffer this is the initial size of the output buffer * @param threshold this is the maximum size of the buffer */ public SocketBufferWriter(Socket socket, Reactor reactor, int buffer, int threshold) throws IOException { this.writer = new SocketBuffer(socket, buffer, threshold); this.flusher = new SocketFlusher(writer, socket, reactor); }