Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Merged remote branch 'bdecoste/Branch_JGroups_3_0' into tmp

- Changed version to 3.0.16
  • Loading branch information...
commit 3d961e77011e2ac274b302907a5516eb3e8b0a3f 2 parents 8abc9f0 + 1387013
Bela Ban authored
2  build.xml
View
@@ -6,7 +6,7 @@
build.xml file for JGroups. Needs Ant (jakarta.apache.org) to run
</description>
- <property name="version" value="3.0.15.Final"/>
+ <property name="version" value="3.0.16.Final"/>
<property name="build.properties.file" value="build.properties"/>
<property file="${build.properties.file}"/>
<property name="root.dir" value="${basedir}"/>
2  pom.xml
View
@@ -5,7 +5,7 @@
<artifactId>jgroups</artifactId>
<packaging>bundle</packaging>
<name>JGroups</name>
- <version>3.0.15.Final</version>
+ <version>3.0.16.Final</version>
<url>http://www.jgroups.org</url>
<description>
Reliable cluster communication toolkit
4 src/org/jgroups/Version.java
View
@@ -21,8 +21,8 @@
public class Version {
public static final short major = 3;
public static final short minor = 0;
- public static final short micro = 15;
- public static final String description="3.0.15.Final";
+ public static final short micro = 16;
+ public static final String description="3.0.16.Final";
public static final short version=encode(major, minor, micro);
public static final String string_version=print(version);
41 src/org/jgroups/blocks/TCPConnectionMap.java
View
@@ -24,6 +24,7 @@
private final Mapper mapper;
private final InetAddress bind_addr;
+ private final boolean defer_client_bind_addr;
private final Address local_addr; // bind_addr + port of srv_sock
private final ThreadGroup thread_group=new ThreadGroup(Util.getGlobalThreadGroup(),"ConnectionMap");
private final ServerSocket srv_sock;
@@ -47,18 +48,33 @@ public TCPConnectionMap(String service_name,
SocketFactory socket_factory,
Receiver r,
InetAddress bind_addr,
+ boolean defer_client_bind_addr,
InetAddress external_addr,
int external_port,
int srv_port,
int max_port
) throws Exception {
- this(service_name, f,socket_factory, r,bind_addr,external_addr,external_port, srv_port,max_port,0,0);
+ this(service_name, f,socket_factory, r,bind_addr,defer_client_bind_addr,external_addr,external_port, srv_port,max_port,0,0);
+ }
+
+ public TCPConnectionMap(String service_name,
+ ThreadFactory f,
+ SocketFactory socket_factory,
+ Receiver r,
+ InetAddress bind_addr,
+ InetAddress external_addr,
+ int external_port,
+ int srv_port,
+ int max_port
+ ) throws Exception {
+ this(service_name, f,socket_factory, r,bind_addr,false,external_addr,external_port, srv_port,max_port,0,0);
}
public TCPConnectionMap(String service_name,
ThreadFactory f,
Receiver r,
InetAddress bind_addr,
+ boolean defer_client_bind_addr,
InetAddress external_addr,
int external_port,
int srv_port,
@@ -66,7 +82,21 @@ public TCPConnectionMap(String service_name,
long reaper_interval,
long conn_expire_time
) throws Exception {
- this(service_name, f, null, r, bind_addr, external_addr, external_port, srv_port, max_port, reaper_interval, conn_expire_time);
+ this(service_name, f, null, r, bind_addr, defer_client_bind_addr, external_addr, external_port, srv_port, max_port, reaper_interval, conn_expire_time);
+ }
+
+ public TCPConnectionMap(String service_name,
+ ThreadFactory f,
+ Receiver r,
+ InetAddress bind_addr,
+ InetAddress external_addr,
+ int external_port,
+ int srv_port,
+ int max_port,
+ long reaper_interval,
+ long conn_expire_time
+ ) throws Exception {
+ this(service_name, f, null, r, bind_addr, false, external_addr, external_port, srv_port, max_port, reaper_interval, conn_expire_time);
}
public TCPConnectionMap(String service_name,
@@ -74,6 +104,7 @@ public TCPConnectionMap(String service_name,
SocketFactory socket_factory,
Receiver r,
InetAddress bind_addr,
+ boolean defer_client_bind_addr,
InetAddress external_addr,
int external_port,
int srv_port,
@@ -84,6 +115,7 @@ public TCPConnectionMap(String service_name,
this.mapper = new Mapper(f,reaper_interval);
this.receiver=r;
this.bind_addr=bind_addr;
+ this.defer_client_bind_addr = defer_client_bind_addr;
this.conn_expire_time = conn_expire_time;
if(socket_factory != null)
this.socket_factory=socket_factory;
@@ -378,7 +410,8 @@ public String toString() {
SocketAddress destAddr=new InetSocketAddress(((IpAddress)peer_addr).getIpAddress(),((IpAddress)peer_addr).getPort());
this.sock=socket_factory.createSocket("jgroups.tcp.sock");
try {
- this.sock.bind(new InetSocketAddress(bind_addr, 0));
+ if (!defer_client_bind_addr)
+ this.sock.bind(new InetSocketAddress(bind_addr, 0));
Util.connect(this.sock, destAddr, sock_conn_timeout);
}
catch(Exception t) {
@@ -785,7 +818,7 @@ public TCPConnection getConnection(Address dest) throws Exception { //S. Simeono
}
catch(Exception ex) {
if(log.isTraceEnabled())
- log.trace("failed creating connection to " + dest);
+ log.trace("failed creating connection to " + dest + ": " + ex);
if(conn != null) { // should not happen, either conn.start or addConnection failed -still make sure
// it's a "proper rollback"
TCPConnection existing;
2  src/org/jgroups/protocols/BasicTCP.java
View
@@ -47,6 +47,8 @@
@Property(description="SO_LINGER in msec. Default of -1 disables it")
int linger=-1; // SO_LINGER (number of ms, -1 disables it)
+ @Property(description="If true, client sockets will skip binding to bind_addr")
+ protected boolean defer_client_bind_addr=false;
/* --------------------------------------------- Fields ------------------------------------------------------ */
4 src/org/jgroups/protocols/TCP.java
View
@@ -64,6 +64,7 @@ public void start() throws Exception {
ct=createConnectionMap(reaper_interval,
conn_expire_time,
bind_addr,
+ defer_client_bind_addr,
external_addr,
external_port,
bind_port,
@@ -122,6 +123,7 @@ protected void handleDisconnect() {
protected TCPConnectionMap createConnectionMap(long reaperInterval,
long connExpireTime,
InetAddress bindAddress,
+ boolean defer_client_bind_addr,
InetAddress externalAddress,
int external_port,
int startPort,
@@ -134,6 +136,7 @@ protected TCPConnectionMap createConnectionMap(long reaperInterval,
getSocketFactory(),
this,
bindAddress,
+ defer_client_bind_addr,
externalAddress,
external_port,
startPort,
@@ -156,6 +159,7 @@ protected TCPConnectionMap createConnectionMap(long reaperInterval,
getSocketFactory(),
this,
bindAddress,
+ defer_client_bind_addr,
externalAddress,
external_port,
startPort,
Please sign in to comment.
Something went wrong with that request. Please try again.