Monitoring the status of a socket...

I'm using ServerSocket and Socket in a simple client/server model. The situation is unique in that there is only ever one client - ever. That is, the server starts up and listens for the client to connect, once connected the client and server communicate through that socket forever and the server stops listening for connection requests - and, when connection is idle the it remains open.
On the server side, when a cleint connects I spawn two threads. One to service incoming data, and another to service the outgoing data. Each thread gets a reference to the socket connection by calling back to the parent (server) thread and requesting the socket reference. (e.g. server.getClientConnection();).
I want to be able to tell if the client has dropped the connection - for what ever reason. If I'm trying to write to the socket when there is no client, I get an exception that I can catch and handle, but I also want to know about the loss of the client when there is no message traffic. I'm exploring java.net.Socket.setKeepAlive() and getKeepAlive(), and I think these methods may be the answer that I'm looking for. However, I'm
not sure how to use them. Once I call setKeepAlive(true), then what? Do you know how to use these methods, or do you know how I can monitor the status of the socket connection otherwise?
If at all possible, I'm trying to avoid creating a "sub-protocol" of "are you there? / yes I'm here." messages. I'm hoping that JAVA can handle it for me.
Your input is greatly Appreciated.
-Craig

where is the method :
java.net.Socket.setKeepAlive()
?????????????????

Similar Messages

  • How to monitor the status change of pp order?

    I want to monitor all of the status change of PP order ,when the status change to DLV, system trigger a idoc to legacy system.
    I added some code in EXIT_SAPLCOBT_001, but I found this user exit only working in CO02, when I use MIGO or MB1C ... tcode to do some GR, the source code is not woking, that means I have to add the code to any entrance of status change????? anybody have some good idea? maybe I have to add a monitor to monitor the table jest ????

    Could you elaborate your requirement please?
    Anyways, the BP transaction display/change mode can be controlled through settings. Goto BP->Extras->Settings->Choose Display/Change/Setting last selected. May be in your system, the setting is 'Setting last selected'. That's why it's showing the last status display/change. If you want it to be display only, you can change the setting to display. But, the settings are user specific and any changes made will reflect for the specific user.

  • Exactly how does OAM (ICM) monitor the status of services?

    Hi all,
    I would like to know how OAM (well, ICM really) monitors services.
    How does ICM check that a service is up and running? Is some sort of query send to the service that it must respond to? Or does ICM merely do a simple check to see if the service is merely "running" in memory or a "running" process.
    The reason I'm asking is because what if the service is "running" as a process but has hung. Checking that it is a currently "running" process will return that yes, it is running. But issuing some kind of interrogation request requiring a response will show that is hanging and thus not running.
    Anyone able to shed some kind of light on this for me will be greatly appreciated.
    Thanks,
    -Greg Cubitt
    Oracle South Africa

    You can put the ports that connect an important server as managed in fault managements  "detailed device view".
    DFM doesn't follow HSRPVRRP state
    Cheers,
    Michel

  • Monitoring the email send status (SOST) through program

    Hi All,
    I have send the smartform output to email addresses as attachment. But I am not able to monitor the status of those emails whether the mail address is correct or not. or whether the email have gone or not.
    How to check that?
    Is there any way so that I can access the data of SOST transaction
    Thanks in advance.
    Rgds,
    Madhuri

    Hi Madhuri,
    Please check the code below:
    *----- List of Users
      DATA: lt_user TYPE STANDARD TABLE OF str_agrs,
            lt_user_wa LIKE LINE OF lt_user.
    *----- For object data
      DATA: lt_obj_data    TYPE STANDARD TABLE OF sodocchgi1,
            lt_obj_data_wa LIKE LINE OF           lt_obj_data.
    *----- For receiver
      DATA: lt_rec TYPE STANDARD TABLE OF somlreci1,
            lt_wa  LIKE LINE OF           lt_rec.
    *----- For the text
      DATA:  lt_text_itab TYPE TABLE OF solisti1,
             lt_text_wa   LIKE LINE OF lt_text_itab.
    *----- Data Declaration for Email Address Get
      DATA: lv_email TYPE string,
            lv_subrc TYPE sy-subrc,
            lt_error TYPE STANDARD TABLE OF rpbenerr.
    *---- Get the users list
    CALL FUNCTION 'ESS_USERS_OF_ROLE_GET'
        EXPORTING
          role       = 'SAP_ALL'  "{color:green}Role can be anything depending on your requirement{color}
        TABLES
          role_users = lt_user.
    *----- Pack data inside the table
      READ TABLE lt_user INTO lt_user_wa INDEX sy-tabix.
    *----- Get the address using User ID
      CALL FUNCTION 'HR_FBN_GET_USER_EMAIL_ADDRESS'
        EXPORTING
          user_id       = lt_user_wa-uname
          reaction      = 'S'
        IMPORTING
          email_address = lv_email
          subrc         = lv_subrc
        TABLES
          error_table   = lt_error.
    *------ Receiver Details
      lt_wa-receiver = lv_email.
      lt_wa-rec_type = 'U'.
      lt_wa-com_type = 'SOTR'.
      APPEND lt_wa TO lt_rec.
      CLEAR  lt_wa.
    *------ Call method to send the mail
      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
        EXPORTING
          document_data              = lt_obj_data_wa
          document_type              = 'RAW'
          commit_work                = 'X'
        TABLES
          object_content             = lt_text_itab
          receivers                  = lt_rec
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc <> 0.
        <log>
    ENDIF.
    Try this,
    Regards,
    -Syed.
    Edited by: wahid hussain syed on May 14, 2009 8:55 AM

  • Use SNMP to monitor the power supply status of stacked switches

    Does anybody know how to use SNMP to monitor the status of the internal power supplies of a group of stacked Cisco 3750 switches?
    The switch stack has three 3750-48PS-E switches inter-connected by Cisco StackWise cable. IOS ver 12.1(19)EAlc. A single IP address is used to identify the switch stack. Every time I poll the OID chassisPs1Status (1.3.6.1.4.1.9.5.1.2.4.0 in CISCO-STACK-MIB), I only got the status for the Master switch of the switch stack. Is there any way to poll the power supply status of other switches in the switch stack?
    Thanks a lot!

    Sorry to refresh such an old topic - but I am stuck with exactly this: Monitoring power supplies of a stacked Cisco Catalyst 3750-E.
    I'm using the exact same OID's as described, but the problem is, the information shown on the SNMP output is not correct.
    This morning, a power supply of the first switch failed and switched to RPS. Here the information I got on SNMP:
    snmpwalk -v 2c -c public 192.168.1.50 1.3.6.1.4.1.9.9.13.1
    SNMPv2-SMI::enterprises.9.9.13.1.1.0 = INTEGER: 13
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.2.1006 = STRING: "SW#1, Sensor#1, GREEN "
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.2.2006 = STRING: "SW#2, Sensor#1, GREEN "
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.3.1006 = Gauge32: 41
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.3.2006 = Gauge32: 40
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.4.1006 = INTEGER: 59
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.4.2006 = INTEGER: 59
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.5.1006 = INTEGER: 0
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.5.2006 = INTEGER: 0
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.6.1006 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.3.1.6.2006 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.4.1.2.1060 = STRING: "Switch#1, Fan#1"
    SNMPv2-SMI::enterprises.9.9.13.1.4.1.2.2059 = STRING: "Switch#2, Fan#1"
    SNMPv2-SMI::enterprises.9.9.13.1.4.1.3.1060 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.4.1.3.2059 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.2.1059 = STRING: "Sw1, PS1 Normal, RPS NotExist"
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.2.2060 = STRING: "Sw2, PS1 Normal, RPS NotExist"
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.3.1059 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.3.2060 = INTEGER: 1
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.4.1059 = INTEGER: 2
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.4.2060 = INTEGER: 2
    As you see, both PS1 (for both switches) are appearing normal. It doesn't even recognize RPS:
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.2.1059 = STRING: "Sw1, PS1 Normal, RPS NotExist"
    SNMPv2-SMI::enterprises.9.9.13.1.5.1.2.2060 = STRING: "Sw2, PS1 Normal, RPS NotExist"
    The first switch's power supply died and now the cable is disconnected. LED's of the power supply are out. And still: The switch happily announces by SNMP it's power supplies are up.
    Is this a known bug? If yes, has it been fixed?
    Model  WS-C3750E-48TD
    Firmware 12.2(37)SE1
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Table Normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
    mso-para-margin:0cm;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;
    mso-bidi-font-family:"Times New Roman";
    mso-bidi-theme-font:minor-bidi;}

  • Is there a way to track the status of a process?

    Hi all,
    after user completes a process, user later might want to know what stage this process is in, user want to keep track.
    is there a way to do so? 
    i tried the UWL's "Completed tasks" it only shows me some very basic infos. i want to know what stage the process is in right now. how?
    thanks in advance.

    Hi,
      There are NWA Applications to monitor the status of process and tasks.
    Please go to NWA HomePage -> Operation MAnagement -> Manage Process  (there is also a link Manage Tasks).
    Here, you could have the status of the process, with its details, context data, business logs etc.
    Hope this helps !
    Karthik

  • [XI 3.1] Monitoring Service Status...?

    In BOE-XI (R2) we could use tools like HP-OpenView to monitor the status of the various BOE-servers because they ran as individual Windows Services - and could be seen from the WINDOWS Services Menu (or CCM).
    HP-OpenView could send us e-mail alerts when a service went down (eg. CMS).
    Now, in BOE-XI (Release 3.1) only the Server Intelligence Agent (SIA) runs as an individual Windows Services - and can be seen from the WINDOWS Services Menu (or CCM).
    Anyone figured-out how to "monitor" and "alert" the status of the BOE-XI (Release 3.1) services...?

    yep use a tool like sysinternals process explorer to lookup the child processes in XI 3.x if you need a list of PID's. In XI 3.x the SIA is the parent service and everything else is just a child process going forward.
    Regards,
    Tim

  • Monitoring system status in BAM

    Hi,
    Our Customer requires system status monitoring so the question is:
    Is it possible to monitor the status of the Database, the App server and the BPEL server and display it in BAM in a not too complicated way.
    Regards Eskil

    Old question, but never too late to answer for others I guess.
    http://www.oracle.com/technology/products/integration/bam/10.1.3/TechNotes/em_de.pdf

  • Monitoring the email connector

    We currently have the ability for users to submit tickets into Service Manager via email.
    Can someone suggest a way we can monitor the email connector flow...so that if the emails stop working we can receive an alert?

    Hi,
    You can add an event log's monitor in SCOM for events with the source
    Exchange Connector in the Operations Manager log of the SCSM management server where Exchange connector is deployed. It will help to catch errors. However, if for some reasons the connector's workflow doesn't run at all, you have to monitor the
    status of the rule that EC's wizard creates. The EC's rule name always looks like ExchangeConnector.eac55a54037b43f78d83e6fhaf59d657, so you can get it by running the PS code like this from the Service Manager shell:
    Get-SCSMConnector | ? {$_.DisplayName -like 'Exchange*'} | %{$_.ConnectorId}
    Cheers,
    Marat
    Site: www.scutils.com  Twitter:
    LinkedIn:
    Graveyard:

  • Cisco SPA - Monitoring Line Status

    Hi,
    I have a Cisco SPA112, though this would apply to the Cisco SPA122 as well.
    It has the latest 1.3.2 firmware on it.
    I want to monitor the status of Line 1.  If I changes to being Unregistered, I want to know.
    How are people doing this at the moment?
    I can SNMP walk the device, but I can't see an obvious OID there that gives me the status.
    How are people monitoring the status of their ATA's?
    Thanks!
    Tim

    Is there any way to get the Line 1 status from the web page without having to login?
    Or is there a way to login programatically using wget etc?         

  • Monitoring Raid Status on SRE-910 module in 3945 router

    I'm at my wits end here.  We just recently purchased a 3945 ISR G2 router and have a SRE-910 module (with two hard drives) configured in a Raid 1.  We are running a stand-alone version of ESXi on the service module and I'm trying to figure out how to monitor the status of the Raid on the drives (along with other health issues).  SNMP has revealed nothing so far and even opening a support case for which MIB's to use has proved fruitless.  All the documents I find on monitoring the modules say to use LMS which is now Cisco Prime.  I've downloaded the trial copy, put in the SNMP settings and scanned the router.  I get device results and it shows that I have the SRE-910 module installed, but I get no other configuration / device informaiton from the module itself.
    I tried to create a new Monitoring template using the NAM health as the base template (which I'm assuming this is the correct template).  Unfortunately, when I acutally try to deploy the template against the discovered router, I get an 'Unexpected end of list' error which makes me assume I'm still doing something wrong.  I ANYONE out there monitoring the device health of their service modules in a 3945 router?  What am I missing????

    Oh, and by the way, I tried to monitor this through the ESXi host / vCenter, but even after pulling one of the hard drives from the module, neither software detected that there was an issue.  That is why I'm assuming that this will have to be monitored on the router side somehow.

  • How to capture the Status code in Web application Transcation monitoring if we are using multiple Request

    Hi Team
    We would like to monitor 12 url,s which requires Authentication. Hence i have added the same in one Single Web application transcation template.
    i have added the below info to the get the Stats code displayed in Alert
    Status code is $Data/Context/RequestResults/RequestResult["1"]/BasePageData/StatusCode$
    when i recived a alert it gave the Status code of the 1st Request
    hence i changed the same as
    Status code is $Data/Context/RequestResults/RequestResult["12"]/BasePageData/StatusCode$
    But still i am facing the same issue .
    My first request shows me a status code of 200, and my 12th Request comes with 500 but in the alert i get 200 but it should be 500.
    Kindly help me in how i can get the Status code for the multiple  Request.
    Regards
    Sriram

    Hi Sriram,
    Please run the test of your 12th Request, view full result and check if Status Code is 200.
    Meanwhile, you can run the URL manually to check the result.
    Niki Han
    TechNet Community Support

  • Error in the Status Monitor page

    I have been getting the following error, for the notification in the status monitor page:
    9004: An error has occurred in workflow processing: 3835: Error '-6508 - ORA-06508: PL/SQL: could not find program unit being called' encountered during execution of Generate function 'WF_XML.Generate' for event 'oracle.apps.wf.notification.send'.. The stack trace of the error is:
    Wf_Event.setMessage(oracle.apps.wf.notification.send, 2762135, WF_XML.Generate)
    Wf_Event.dispatch_internal()
    I am not able to understand what it is

    For some reason the changes i am trying to save to database is not getting reflected, when i check out the diagram in the Status Monitor.
    Also i am getting this error, while saving the Workflow into the database:
    1602: Could not save.
    1400: Could not save to database. MODE=UPGRADE EFFDATE=2009/05/20 12:16:36
    1401: Could not upload ACTIVITY entity 'HRSSA/HR_MAINTAIN_SIT'.
    1401: Could not upload ATTRIBUTE entity '<null>/P_SIT_LOOKUP'.
    210: Oracle Error: ORA-01653: unable to extend table APPLSYS.WF_ACTIVITY_ATTRIBUTES_TL by 16 in tablespace APPS_TS_SEED
    ORA-01403: no data found
    ORA-06512: at "APPS.WF_LOAD", line 1713
    ORA-06512: at line 1
    . SQL text: BEGIN WF_LOAD.UPLOAD_ACTIVITY_ATTRIBUTE(:activity_item_type, :activity_name, :activity_version, :name, :display_name, :description, :sequence, :type, :protect, :custom, :subtype, :format, :default, :value_type, :level_error); END;

  • Mysterious Missing "Monitor SQL Status" Triangle icon in the SQL Worksheet

    According to the help file, there is a feature in SQL Worksheet which I am not seeing, even though I have the most recent release (1.5.4) and am accessing 11.1.0.7 databases. I don't even see the triangle icon which is supposed to be located between the "cancel" and "execute explain plan" buttons on the SQL Worksheet toolbar.
    "Monitor SQL Status (Oracle Database Release 11.1 and later only) calls the real-time SQL monitoring feature of Oracle Database, enabling you to monitor the performance of SQL statements while they are executing."
    Is this working for anyone else? Any idea what might be preventing me from accessing this feature?

    This is now a menu option. Tools > Monitor SQL.
    Sue

  • Does anyone know the status of the new CMYK monitor display Apple is developing?

    Does anyone know the status of the new CMYK monitor display Apple is developing?

    I have the same iMac as you but with a 1 TB hard drive.
    Apple replaced the 1 TB hard drive of iMacs manufactured between October 2009 and July 2011 because of problems. When I took my iMac, the Genius gave me the bill (even if the repair was free) and the 1 TB hard drive cost about $100. This was with a 1 TB Seagate hard drive, so the cost for a 500 GB hard drive may be smaller, depending on the brand

Maybe you are looking for

  • Inserting links in a form

    Can I insert [hyper]links into a form to be deployed as a PDF dopcument? I'd like to allow respondents to navigate around the form.

  • Every other Youtube video won't play

    I am using Chrome so I don't know if this is the appropriate place to ask for help.  Every other youtube video or other video I try to play will not load.  I just get this constant spinning circle of white dots.  I did see that I had accidently downl

  • Error updating attribute in VO

    Hi, I need to set the value of an attribute in a seeded VO. But it gives me an error if I try to commit the changes. oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND_RECORD_CHANGED_ERROR.      at oracle.apps.fnd.framework.se

  • Thread Pools

    Hi Everyone; I have a Runnable class called Page. during the course of my program's execution it might make 300 of these Page threads per hour. Someone suggested that I might have a performance and resource penalty for creating these threads. They su

  • Launch another Tabpage

    Hi all, I use Panel Tab one page .One tab page contain the Link button.When I click(mean Action) the Link button than Other tab will be active. How Can I solved it. Helping Hands are highly Encouraged. Regards Shekhar Edited by: user12084240 on Nov 1