Example usage for org.apache.mina.transport.tcp TcpSessionConfig setReadBufferSize

List of usage examples for org.apache.mina.transport.tcp TcpSessionConfig setReadBufferSize

Introduction

In this page you can find the example usage for org.apache.mina.transport.tcp TcpSessionConfig setReadBufferSize.

Prototype

void setReadBufferSize(int readBufferSize);

Source Link

Document

Sets the size of the read buffer that I/O processor allocates per each read.

Usage

From source file:org.geb.core.thrift.TcpServer.java

public TcpServer(final int port) {
    this.port = port;

    final TcpSessionConfig tcpSessionConfig = new DefaultTcpSessionConfig();

    tcpSessionConfig.setReadBufferSize(8192);
    tcpSessionConfig.setSendBufferSize(8192);

    tcpSessionConfig.setIdleTimeInMillis(IdleStatus.READ_IDLE, 10000l);
    tcpSessionConfig.setIdleTimeInMillis(IdleStatus.WRITE_IDLE, 10000l);

    ioServer = new NioTcpServer(tcpSessionConfig);
}

From source file:org.geb.core.transport.tcp.mina.MinaTcpServer.java

public MinaTcpServer(final int port, final String srcPeerID, final boolean noProp) throws UnknownHostException {
    this.port = port;
    this.protocolAddress = InetAddress.getLocalHost().getHostAddress() + ":" + port;
    this.srcPeerID = srcPeerID;
    //        this.welcomeMessage = welcomeMessage;
    this.noProp = noProp;

    final TcpSessionConfig tcpSessionConfig = new DefaultTcpSessionConfig();

    tcpSessionConfig.setReadBufferSize(Constants.MAX_MESSAGE_LENGTH);
    tcpSessionConfig.setSendBufferSize(Constants.MAX_MESSAGE_LENGTH);

    tcpSessionConfig.setIdleTimeInMillis(IdleStatus.READ_IDLE, 10000l);
    tcpSessionConfig.setIdleTimeInMillis(IdleStatus.WRITE_IDLE, 10000l);

    ioServer = new NioTcpServer(tcpSessionConfig);
}