How to get status of server side

Dear All,
I have developed the client program for communicating with server (Which can be developed again java or any language and on running on any platform ). So now I can connect with server and continue the communication but suppose if server down or unplugging the network wire, then how I know of that in client side programming. I try to some way but it does not work correctly.
private void  monitor() throws Exception{
              isConnected = s.isConnected() &&
                           !s.isClosed() &&
                            InetAddress.getByName("192.168.1.115").isReachable(1000);
     public void run() {
          while (true){
               try {
                    Thread.sleep(2000);
                    monitor();
                    if(s !=null)
                         System.out.println(isConnected);
               } catch (Exception e) {
                    e.printStackTrace();
     } "s" is the created socket which bound at a one time to continue communication
InetAddress addr = InetAddress.getByName("192.168.1.115");
          SocketAddress sockaddr = new InetSocketAddress(addr,
                    8670);
          Socket s = new Socket();
          s.connect(sockaddr, 5000); Thing is it always print "true " even if the server is down
Can you tell me what is the way to check this ?
Regards
-Kapila

     isConnected = s.isConnected() &&Tells you whether you have called connect(), implicitly or explicitly, or got the socket from an accept().
     !s.isClosed() && Tells you whether you have closed the socket.
Neither of these tells you anything about the state of the connection.
     InetAddress.getByName("192.168.1.115").isReachable(1000);Meaningless.
The only way to tell whether a server can be connected to is to try to connect to it.
The only way to tell whether a server can be written to is to try to write to it, taking network buffering into account.
The only way to tell whether a server can be read from is to set an appropriate read timeout and try to read from it.
TCP doesn't maintain any other information about the state of a connection.

Similar Messages

  • How to get file from server while click on link

    Hi,
    i created on link and i gave one server path to select file from server but while clickinng on link it no displaying any thing.
    following is the Destination url that i gave for the item.
    /u08/app/appvis/xxex/inst/xxex_apps/xxrbe/logs/appl/conc/log/
    please tell me how to get file from server while click on link.

    Ok I got your requirement now.
    If you are getting file names from view attribute then you should not be adding destination URI property for the link.
    Instead you can use OADataBoundValueViewObject API.
    Try below code in your controller processRequest method:
    I am assuming that you are using classic table.
    Also in below example it considers OAMessageStyleText and you can replace it with link item if you want.
    OATableBean tableBean =
    (OATableBean)webBean.findChildRecursive("<table item id>");
    OAMessageStyledTextBean m= (OAMessageStyledTextBean)tableBean.findChildRecursive("<message styled text in table item id>");
    OADataBoundValueViewObject tip1 = new OADataBoundValueViewObject(m, "/u08/app/appvis/xxex/inst/xxex_apps/xxrbe/logs/appl/conc/log/"+"<vo attr name which stores file name for each row>");
    m.setAttributeValue(oracle.cabo.ui.UIConstants.DESTINATION_ATTR, tip1);
    Regards,
    Sandeep M.

  • How to get the report server name in Forms 10g.

    How to get the report server name in Forms 10g.
    I'm using the Application Server 10g 10.1.2.

    Hello,
    I do not think that you can get this value from anywhere. A solution is to put the Reports server name in an environment variable stored in the /forms/server/default.env file, then to query it at Forms runtime with the TOOL_ENV.Getvar() built-in.
    Francois

  • How to get status of transaction

    Hi Gurus,
    can anyone tell me how to get status of the transaction in crm.
    regards,

    hi vijay,
    what kind of transaction did you want to get the status ?
    for order, complaint, activity, and task, you can used function modul 'CRM_ORDER_READ' for getting status of the document.
    hopes it helps
    cheers

  • CRM document - how to get status duration?

    Dear all,
    I extract data CRM -> BI  using standard datasources: 0CRM_SRV_PROCESS_H, 0CRM_COMPLAINTS_I, etc
    I need build a report with status duration of documents
    For example, if document was processed 4 days in statuses OPEN > IN PROCESS > VALIDATION > CLOSED report should be following:
    OPEN - 1 day
    IN PROCESS - 2 days
    VALIDATION - 1 day
    Each CRM datasource has start date and last change date of the document
    But there is no fields which stores date or duration of intermediate status change
    Could you please give an advice - how to get status duration?
    Thanks in advance

    Hi Oleg,
    Please check whether following standard datasources could meet your requirements:
    0CRM_TSS_DTRACK  CRM Tracking of Document Processing Lifecycles
    0CRM_TSS_PKYF       Timestamp Service: Performance Key Figures
    You can find the documents in transaction code SBIW, through IMG path
       Settings for Application-Specific DataSources (CRM)
           -> Settings for Extracting CRM Objects
                 ->  Define Extraction to Track the Document Processing Life Cycle   
                  -> Define Performance Key Figures for Time Stamp Service Analysis
    Best Regards,
    York

  • Can anyone tell me how to get rid of the side menu in Safari ios8?  Thatnk you.

    Can anyone tell me how to get rid of the side menu in Safari ios8?

    Click at the top of the browser where it looks like an open book that should do it.

  • How RMI implements multithreading in Server-side?

    In [http://my.execpc.com/~gopalan/java/rmi_internals.html] says:
    "On the server side, when a client connects to the server socket, a new thread is forked to deal with the incoming call. The original thread can continue listening to the original socket so that additional calls from other clients can be made."
    I have traced Java source code (jdk-6u18-ea-src-b05-jrl-18_nov_2009.jar) , but i could not find where and how Java RMI do it.
    Could anyone give me some hint? Thanks!

    In [http://my.execpc.com/~gopalan/java/rmi_internals.html] says:
    The status of that site is zero. All you can rely on is the RMI specification.
    "On the server side, when a client connects to the server socket, a new thread is forked to deal with the incoming call. The original thread can continue listening to the original socket so that additional calls from other clients can be made."That accurately describes the Sun implementation of RMI as of 1.5, the latest source code I have looked at. It doesn't accurately describe the IBM implementation nor I suspect the Sun 1.6 implementation.
    I have traced Java source code (jdk-6u18-ea-src-b05-jrl-18_nov_2009.jar) , but i could not find where and how Java RMI do it. So? Why does it matter? The RMI specification tells you what the multi-threading guarantees of RMI are. They are all you can rely on.

  • How to parse XML in server side javascript (XSJS)?

    Hi Experts,
    I can get the XML file content through this method:var xmlString = $.response.body.asString() and I need to parse XML. If there XML parser in server side javascript? thanks very much!

    Hi Wenwen Hou,
    There is a blog available at
    Parse XML in server side javascript (XSJS)
    This can help you achieve parsing xml in server side javascript.
    Regards,
    Anjali.

  • How to start streaming from server side after applet initialized on client

    Hi,
    I am using JSP for on demand streaming server.
    I have included an applet in jsp page which start new player on client side after on streamreceive event.
    But my problem is how to give call to server that applet on client side has been initialized and now streaming can go on.
    Is there any method / way to call class file which will start streaming?

    Oracle is designed to support connection from client to server. The client originates the connection.
    If you want the server to initiate the connection, you need to make the server pretend it is a client. Oracle even does this internally, when they want to use 'External Procedures'
    You may also use Oracle's Message Queue mechanism, called 'Advanced Queueing' to use a 'publish subscribe' model instead of a connection model. That is discussed in the Advanced Queue manual in the documentation at http://docs.oracle.com
    Finally, you can explore the possibility of using RMI from the database, as discussed in the Java related documentation at the same location.

  • How to get orchestration instance server name

    I have two server where orchestration can run...I need to know the server name where my orchestration instance has run.
    How to get this information...

    When you have more than one BizTalk-processing server and if your orchestration is bound to host instance which exist in more than one server (generally for better resilience, the best practice
    is to have multiple instances of host in different servers), the idea of get the server name where Orchestration instance has run is INVALID.
    With the BizTalk features like scalability, resilience and persistence points an Orchestration instance could run in more than one server.
    For example due to persistence points, if that BizTalk server were to suffer a power outage, another BizTalk server could continue the orchestration from the checkpoint rather than having
    to start the orchestration from the beginning. Or during or during long-running process while waiting for a response, then message being consumed by an orchestration instance would be persisting the in-memory representation of an orchestration (to its last
    good state) and any associated messages in BizTalk MessageBox. So when the response comes back the rest of the part of orchestration could execute from other server instance. So an orchestration would not always run from one server.
    But if you have specific “Expression shape” which you may have been using for logging/tracing then you can get the server name which executed that particular “Expression shape” from an Orchestration
    instance (not the whole Orchestration instance). This is done using the standard .NET code to get the server name -
    System.Environment.MachineName
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How to get status codes of field?

    For every document type or status field which we can see on front end, there is code which is finally stored in table.
    e:g: Go to transaction /nme53n
            Select any purchase req.
            Select status tab from item.
            See – processing status field.
            These processing status saves as N,B, etc in table.
    I know there is way to see these codes followed by full description on front end screen itself. I think using personal settings, but dont know how to set this. Please let me know how to see status codes + description on front end.

    You gui status should be implemented in the main screen which the subscreen resides, all function codes should be handled at that level. I believe you will need to set the F2 funciton code in your gui status, set the function code to PICK and then handle this function code in your PAI user command module. Should work.
    subscreen cannothave their own pf-status.....so create a pf-status for a screen in which ur subscreen is called...include 'pick' or f2 as onre of the functions code for the choose option.
    to differentiate the field u have to use get cursor field fldname.
    if it is a table control field u have to use
    get cursor field <fldaname> line <n> value <fval>

  • How to get DEV Integration Server into Prod SLD?

    Hello,
    in a two-tier landscape I need to define transport targets in SLD. Both PI syetems have their own SLD. In each SLD there is just the Integration server of the corresponding PI system. How to get the DEV Integration Server into PROD sld? Manually?
    Thanks,
    CHRISTOPH

    Hello Seshagiri,
    that is what I wanted to know. So there seem to be two possibilities:
    - Creating the DEV Integration Server in productive SLD manually
    - Exporting the DEV Integration Server from DEV SLD and import it into productive SLD.
    I tried importing / exporting SLD content some time ago. AFAIK there is no exporting single technical / business systems, you can just export all the content together from a SLD?
    Thanks,
    Christoph

  • How to get status profile (STSMA) in user exit ILOM0001

    Hi ABAPers,
    I am currently working on user exit ILOM0001 (Check before saving a functional location) and need to get information about status profile (STSMA). I have checked parameters that is imported into this user exit (DATA_IFLO, DATA_IFLO_OLD, DATA_IFLOS) and none of them have STSMA.
    Could anybody help me how to get this field STSMA into user exit ILOM0001?
    Appreciate it.
    Thanks
    Regards
    Hadi

    Dear Kolla,
    Really appreciate your answer, but
    I don't want to generate or make settlement receiver.
    I was building a script in user exit IW010009,
    And the issue is I can not capture the content of field settlement receiver.
    If we want to capture screen field, ex. equnr, we can use structure CAUFVD,
    when i see the technical detail in this field, the structure for settlement is DKOBR, field EMPGE, but i cannot call it on debug.
    Kindly need your help on this issue.

  • How to get port of server in component running.

    Hi all,
    How can get information of port no of server in which component working,

    u can get by using sharedObects
    see this
    http://www.techartifact.com/blogs/2013/10/get-intradoc-server-port-in-custom-component-in-webcenter-content-ucm.html

  • How to get the Weblogic Server Id from within java code

    I would like to log which server (among a cluster) a certain job is running on. Is there a way to get the server id from within Java code (this code is in a session bean if that is relevant.)
    By server id I mean the "Name" column in the summary of servers on the weblogic console.
    Thanks,
    ken

    Use the two entries close to the bottom of the page: "list WebLogic
    MBeans:listMBeans.jsp
    display MBean attributes and operations:showMBean.jsp"
    Nils
    Anatoly wrote:
    >
    Cameron,
    That page has these items on it:
    which one do you think helps with my issue?
    Misc WebLogic examples
    LongRunningTask
    Execute tasks in parallel using WebLogic Execute Threads
    Weblogic stats (5.1)
    Reload Servlet(s) programmatically (5.1)
    Network classload from WebLogic:using reflection,or the launcher
    Weblogic 5.1 debugging properties
    Seppuku pattern readme
    Using dynamic proxies to intercept EJB invocations (6.1)
    list WebLogic MBeans:listMBeans.jsp
    display MBean attributes and operations:showMBean
    Thanks to Marcelo Caldas for filter by type option and nice UI!
    Using com.sun.jdmk.comm.HtmlAdaptorServer with WebLogic 6.1
    Cool
    EJBGen
    Dimitri
    back
    "Cameron Purdy" <[email protected]> wrote in message news:<3c7a745d$[email protected]>...
    JMX ... see http://dima.dhs.org/misc/ for some info on JMX in Weblogic.
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    Clustering Weblogic? You're either using Coherence, or you should be!
    Download a Tangosol Coherence eval today at http://www.tangosol.com/
    "Anatoly" <[email protected]> wrote in message
    news:[email protected]..
    Does anyone know who to get the managing server URL's port
    from within the EJB code running on Weblogic 6.1?
    The URL port is not default (not 7001), but when creating
    initial context, I am not specifying the URL in properties.
    Due to that, trying to the the PROVIDER_URL property from
    environment does not return anything.
    Appreciate any responses.
    -Anatoly
    ============================
    [email protected]

Maybe you are looking for