org.jgroups.blocks.cs.TcpBaseServer Maven / Gradle / Ivy
Go to download
This artifact provides a single jar that contains all classes required to use remote EJB and JMS, including
all dependencies. It is intended for use by those not using maven, maven users should just import the EJB and
JMS BOM's instead (shaded JAR's cause lots of problems with maven, as it is very easy to inadvertently end up
with different versions on classes on the class path).
package org.jgroups.blocks.cs;
import org.jgroups.Address;
import org.jgroups.util.SocketFactory;
import org.jgroups.util.ThreadFactory;
/**
* Common base class for TCP based clients and servers
* @author Bela Ban
* @since 3.6.5
*/
public abstract class TcpBaseServer extends BaseServer {
protected int peer_addr_read_timeout=2000; // max time in milliseconds to block on reading peer address
protected TcpBaseServer(ThreadFactory f, SocketFactory sf, int recv_buf_size) {
super(f, sf, recv_buf_size);
}
@Override
protected TcpConnection createConnection(Address dest) throws Exception {
return new TcpConnection(dest, this);
}
public int peerAddressReadTimeout() {return peer_addr_read_timeout;}
public TcpBaseServer peerAddressReadTimeout(int timeout) {this.peer_addr_read_timeout=timeout; return this;}
}