Issue #599 has been reported by David Coutadeur. ---------------------------------------- Bug #599: in case of hard TCP/IP disconnection (power cut), asynchronous LSC is not alerted http://tools.lsc-project.org/issues/599
Author: David Coutadeur Status: New Priority: Normal Assigned to: Category: Core Target version: trunk Problem in version: The main problem of this is the JMX monitoring tool that does not report any alert. Here are some elements to solve this problem : in C : setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen) http://traduc.org/Guides_pratiques/Suivi/TCP-Keepalive-HOWTO/Document in java : rewrite a socket factory extending the standard factory. In this factory, set the KEEP ALIVE on the created sockets. Here is an example : <pre> public class MyCustomSocketFactory extends SocketFactory { public MyCustomSocketFactory() { System.out.println("[creating a custom socket factory]"); } public static SocketFactory getDefault() { System.out.println("[acquiring the default socket factory]"); return new MyCustomSocketFactory(); } public Socket createSocket(String host, int port) throws IOException, UnknownHostException { System.out.println("[creating a custom socket (method 1)]"); Socket s = new Socket(host, port); s.*setKeepAlive*(true); return s; } public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException { System.out.println("[creating a custom socket (method 2)]"); Socket s = new Socket(host, port, localHost, localPort); s.*setKeepAlive*(true); return s; } public Socket createSocket(InetAddress host, int port) throws IOException { System.out.println("[creating a custom socket (method 3)]"); Socket s = new Socket(host, port); s.*setKeepAlive*(true); return s; } public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException { System.out.println("[creating a custom socket (method 4)]"); Socket s = new Socket(address, port, localAddress, localPort); s.*setKeepAlive*(true); return s; } </pre> at JNDI level, specify the new socket : <pre> env.put("java.naming.ldap.factory.socket", "MyCustomSocketFactory"); </pre> Some pointers : http://comments.gmane.org/gmane.comp.java.sun.jndi/296 http://old.nabble.com/How-to-set-TCP-Keep-Alive-for-JNDI-Connection---td17273270.html http://java.sun.com/javase/6/docs/api/java/net/Socket.html#setKeepAlive Thanks to Raphael Martz for reporting this issue ! -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://tools.lsc-project.org/my/account
_______________________________________________________________ Ldap Synchronization Connector (LSC) - http://lsc-project.org lsc-dev mailing list [email protected] http://lists.lsc-project.org/listinfo/lsc-dev

