java/protoCtrl/src/main/java/com/pravala/protocol/ctrl/SocketMessageManager.java
public boolean isConnected()
        {
            if ( inboundMessageThread == null
                 || !inboundMessageThread.isAlive()
                 || outboundMessageThread == null
                 || !outboundMessageThread.isAlive() )
            {
                // We are not connected if we are still connecting,
                // or if one of the threads is dead.
                return false;
            }

            if ( tcpSocket != null )
            {
                // We are operating in TCP mode - depends if TCP socket is connected.
                return tcpSocket.isConnected();
            }

            // Otherwise we are in local mode.

            // To be connected, the local socket must be set.
            // In the server mode this is sufficient, because it is only set when
            // we accept a connection. However, sockets accepted this way always
            // return 'false' when calling isConnected().
            // In the client mode we actually check isConnected(), but only if isLocalConnecting is not set
            // (otherwise isConnected() on local socket blocks).

            // So to be connected we need to have a local socket, and either be a server,
            // or that socket should be connected:
            return ( localSocket != null
                     && ( localServerMode == LocalServerMode.AbstractNamespaceServer
                          || localServerMode == LocalServerMode.FilesystemPathServer
                          || ( !isLocalConnecting && localSocket.isConnected() ) ) );
        }
/**
         * Queries whether the link is currently running and connected
         *
         * @return True if the link is running properly and it is connected, false otherwise.
         */
Queries whether the link is currently running and connected
@return True if the link is running properly and it is connected, false otherwise.
Queries whether the link is currently running and connected @return True if the link is running properly and it is connected false otherwise .
public boolean isConnected()
        {
            if ( inboundMessageThread == null
                 || !inboundMessageThread.isAlive()
                 || outboundMessageThread == null
                 || !outboundMessageThread.isAlive() )
            {
                return false;
            }
            if ( tcpSocket != null )
            {
                return tcpSocket.isConnected();
            }
            return ( localSocket != null
                     && ( localServerMode == LocalServerMode.AbstractNamespaceServer
                          || localServerMode == LocalServerMode.FilesystemPathServer
                          || ( !isLocalConnecting && localSocket.isConnected() ) ) );
        }
public boolean isConnected ( ) { if ( inboundMessageThread == null || ! inboundMessageThread . isAlive ( ) || outboundMessageThread == null || ! outboundMessageThread . isAlive ( ) ) { return false ; } if ( tcpSocket != null ) { return tcpSocket . isConnected ( ) ; } return ( localSocket != null && ( localServerMode == LocalServerMode . AbstractNamespaceServer || localServerMode == LocalServerMode . FilesystemPathServer || ( ! isLocalConnecting && localSocket . isConnected ( ) ) ) ) ; }
Queries whether the link is currently running and connected
 @return True if the link is running properly and it is connected, false otherwise.
Queries whether the link is currently running and connected @return True if the link is running properly and it is connected false otherwise .
// We are not connected if we are still connecting, // or if one of the threads is dead. // We are operating in TCP mode - depends if TCP socket is connected. // Otherwise we are in local mode. // To be connected, the local socket must be set. // In the server mode this is sufficient, because it is only set when // we accept a connection. However, sockets accepted this way always // return 'false' when calling isConnected(). // In the client mode we actually check isConnected(), but only if isLocalConnecting is not set // (otherwise isConnected() on local socket blocks). // So to be connected we need to have a local socket, and either be a server, // or that socket should be connected: