How to send echo msg to client after regular time to verify the client

Hi
I have socket program which used for communicating information. tow part client and server.
I am having problem. that is I want to send a msg to client (like echo) after some time duration. so how to do that?
help
Kapila

This is the run method of inner class. when the sever is ideal, the sever has to send the msg to client. I think that I want to declare the this part "byte[] b = byteConcatenate(header, responsefornac,response.length); and out.write(b);" elsewhere. first I want to check the server is ideal then if it is ok, send the msg to client.
problem is how to recognise the client?
          * Description : This inner class is used for handling the client session
     protected class SessionPda implements Runnable
//********************************** DECLARATION OF COMMON VARIABLES ******************************************
     protected     byte[]      request;
     protected     byte[]      response;
     protected      byte[]      header;
     protected      byte[]      requestforserver;
     protected      byte[]      responsefornac;
     protected      Socket      client               ;
//********************************** DEFINE CONSTRACTOR********************************************************
          * Description : This method is using for getting the opening client socket
          * @param e
     public SessionPda(Socket client)
     try
     this.client      =      client;
     catch (Exception e)
          System.out.println(">>>>>>>>>>>>>> This is error is occured when getting the opened clint socket at the inner sessionpda class in serve.>>>>>>>>>>>>>>>>>");
               SysLog.logError(java.util.logging.Level.SEVERE, this.toString(), "Sessionpda()", StackTraceUtil.getStackTrace(e));
     header                     =      new byte[HEADER_SIZE];
     request                =      new byte[PACKET_SIZE];
     response                =      new byte[PACKET_SIZE];
     requestforserver      =      new byte[PACKET_SIZE];
     responsefornac           =      new byte[PACKET_SIZE];
//********************************** OVERRIDING THE RUN METHOD IN JAVA LANG THREAD ****************************************************
          * Description : The proccessing the cliet sessionpda
          * @param request
          * @param respons
          public void run()
          try
               while (true)
                    in     =     new     DataInputStream(client.getInputStream())     ;
                    out     =     new DataOutputStream(client.getOutputStream())     ;
               //PRINTING THE REQUEST INFO-----------------------------------
                    int     len     =     in.read(request,0,PACKET_SIZE)                    ;
                    String recvString = "";
     for (int i = 0; i < len; i++)
          recvString +=adjustString(Integer.toHexString( (int) (request)));
     // System.out.println("Request Information :"+recvString);
     //PEPARING TO TO PRCESS--------------------------------------
     for (int j = 0; j < PACKET_SIZE - 3 ; j++)
               requestforserver[j] = request[j + 3];
     Process p = ProcessFactory.getProcess(request);
     boolean redo = p.doProcess();
     ISOMsg m = new ISOMsg();
m = p.getResponse();
m.setPackager(new ISO87BPackager());
response = m.pack();
//PEPARATRING TO SEND BACK THE RESPOND----------------------
header[1] = (byte) (response.length + 5);
          header[3] = (byte) 00;
          responsefornac[0] = (byte) Integer.parseInt(NII.substring(1,3),16); //17;
          for (int k = 0; k < response.length; k++)
               responsefornac[k + 1] = response[k];
          byte[] b = byteConcatenate(header, responsefornac,response.length);
          out.write(b);
          out.flush();
String sendinString = "";
for (int i = 0; i < response.length + 5; i++)
     sendinString +=
          adjustString(Integer.toHexString( (int) (b[i])));
SysLog.logInfo(java.util.logging.Level.INFO,"Response \n"+ sendinString);

Similar Messages

  • How to send common msg

    Hi
    How to send common Msg to all the users presently logged in.This
    msg should appear as popup in a screen, tell me the procedure or
    tcode.
    regards
    gp

    tcode SM02 will do that, as soon as your user does some kind of action.
    or else, investigate usage of tcode SE37 with function module TH_POPUP.
    or check on the web for ABAP code for program ZPOPUP.

  • How do I get my contacts back after they've disappeared? the contacts are still stored in my phone

    how do I get my contacts back after they've disappeared? the contacts are still stored in my phone I just can't access them through my address book; only through Siri. I've restored my phone & that didn't work so what should I do?

    Re-enter them.
    Once they have been deleted from iCloud they are gone from all devices that sync to that iCloud account.

  • Can anyone tell me how to send a PDF file so that it opens up in the body of the email itself? Thanks

    Can anyone tell me how to send a PDF file so that it opens up in the body of the email itself? Thanks

    That is a function of the recipient's e-mail software understanding what your software sent.  If it doesn't it will always show as an icon or attachment.   It is also a function of both your internet provider and their internet provider accepting messages of that size, and a function of their download attachment settings in their e-mail program.  There is no way to guarantee it will appear inline in the attachment.   The best you can do is attach with Windows Friendly format.  To do that, use the attach toolbar icon that looks like a paperclip, (View menu -> Customize toolbar if invisible) on Mac OS X Mail when composing the message.   A checkbox appears in the file dialog box's bottom to make it Windows friendly when you navigate to pick the PDF file.  That makes it as universally compatible as possible.  It still may not appear inline, but at least you are less likely to be incompatible.

  • How to send my ipad for technical assistance? He fell to the floor but still binds despite problems in the system

    How to send my ipad for technical assistance? He fell to the floor but still binds despite problems in the system

    Here you go: http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=ipod
    Good luck!

  • How to send multiple objects from Client to Server

    Hi
    I have a simple Client - Server architecture. I am trying to send 5 objects from Client to the Server which the server would operate on.
    In the past I've used PrintWriter to pass Strings from Client to Server but now when I am dealing with multiple Objects and PrintWriter not allowing sending of Arrays or ArrayList, how can I send these from the Client to the Server? What would be a good writer to use for this purpose?
    Thanks!

    Thanks, I am looking into ObjectOutputStream but from the API it appears I can only send 1 object at a time. I need to send 5 objects per transaction and then send the next group of 5 objects for another transaction.
    Could you clarify some more on how to put these objects together as a single Object perhaps?
    Thanks

  • HOW TO SEND PERSONALIZED EMAILS (WITH SAME MESSAGE) TO ALL ADDRESSES IN THE ADDRESS BOOK - WITH RECIPIENTS SEEING ONLY THEIR NAME BUT NOT WHO ELSE IS GETTING IT

    HOW TO SEND PERSONALIZED EMAILS WITH THE SAME MESSAGE, BUT WITH THE INDIVIDUAL RECIPIENT'S NAME... (OR NAME AND THE EMAIL ADDRESS) TO ALL ADDRESSES IN THE ADDRESS BOOK - WITH RECIPIENTS SEEING ONLY THEIR OWN NAME WITHIN THE BODY OF THE MESSAGE TO THEM ?
    ALSO, HOW TO ELIMINATE ALL THE OTHER NAMES FROM THE LIST - SO THEY CAN NOT SEE WHO ELSE IS ON THE MAILING LIST, AND WHO ELSE IS GETTING THE SAME MESSAGE?

    In the csv file, the column headers must match the the special references in curly brackets.
    So you either change the column header in .csv file or the bit in the curly brackets in the Template email.
    To change the column header:
    In the example shown below, I wanted to use the first two columns
    'First Name', 'Last Name' note the exact spelling.
    I also wanted the email address which was in a column called 'Primary Email'.
    To make it easier for me, I copied the Primary Email column and inserted it into the third column position and then changed the column header name from 'Primary Email' to 'Email'. (This meant I still had the original column header just in case). see image below.
    But you could just change the column header name from 'Primary Email' to 'Email' without moving column about - up to you.
    At this point check that all the contacts do have a valid email address.
    then save the file.
    If you do not want to edit the .csv file, then you need to edit the template email.
    eg: {{First Name}} {{Last Name}} <{{Email}}>
    change to : {{First Name}} {{Last Name}} <{{Primary Email}}>
    If still having an issue, please post two images.
    One image needs to show the row of column headers used in .csv file.
    The other image needs to show the Template email, so I can see how you have used the curly brackets.

  • How can I make my Logo appear after 10 seconds of loading the background?

    Hi,
    I have an animation Logo flash movie which I want to appear after 10 seconds of loading the background image (Panel_mc)?
    I am using Actionscript 3 to load the Logo.swf movie. The following is the whole code that I have on my action script page:
    stop();
    import fl.transitions.Tween;
    import fl.transitions.easing.*;
    var PanelTween:Tween = new Tween(Panel_mc, "y", Elastic.easeOut, -400, 20, 5, true);
    var l:Loader=new Loader();
    addChild(l);
    l.load(new URLRequest("Logo.swf"));
    l.x = -20;
    l.y = -20;
    l.contentLoaderInfo.addEventListener(Event.INIT, growLoader);
    function growLoader(evt:Event):void {
         l.width = 320;
         l.height = 185;
    Note: I need it because first the background will animate so no one can pay attention to my Logo. Once the background stops animation, My logo needs to be start (animation)?
    How can I do it using Actionscript 3.
    Hope somebody will help me.
    Thanks.

    If you look into the few code elements I mentioned, either in the help documentation or using Google, you will find examples that you can use/modify for your current project.  You'll learn more by doing some work yourself rather than having solutions handed to you. We are all learners... yes, it can be hard, but it gets easier when you work at it.

  • How to do Query optimization?It takes more time to fetch the record from db. Very urgent, I need your assistance

    Hi all
                                     I want to fetch just twenty thousands records from table. My query take more time to fetch  twenty thousands records.  I post my working query, Could you correct the query for me. thanks in advance.
    Query                    
    select
    b.Concatenated_account Account,
    b.Account_description description,
    SUM(case when(Bl.ACTUAL_FLAG='B') then
    ((NVL(Bl.PERIOD_NET_DR, 0)- NVL(Bl.PERIOD_NET_CR, 0)) + (NVL(Bl.PROJECT_TO_DATE_DR, 0)- NVL(Bl.PROJECT_TO_DATE_CR, 0)))end) "Budget_2011"
    from
    gl_balances Bl,
    gl_code_combinations GCC,
    psb_ws_line_balances_i b ,
    gl_budget_versions bv,
    gl_budgets_v gv
    where
    b.CODE_COMBINATION_ID=gcc.CODE_COMBINATION_ID and bl.CODE_COMBINATION_ID=gcc.CODE_COMBINATION_ID and
    bl.budget_version_id =bv.BUDGET_VERSION_ID and gv.budget_version_id= bv.budget_version_id
    and gv.latest_opened_year in (select latest_opened_year-3 from gl_budgets_v where latest_opened_year=:BUDGET_YEAR )
    group by b.Concatenated_account ,b.Account_description

    Hi,
    If this question is related to SQL then please post in SQL forum.
    Otherwise provide more information how this sql is being used and do you want to tune the SQL or the way it fetches the information from DB and display in OAF.
    Regards,
    Sandeep M.

  • Somehow, my Referer Header got set to zero, and I'm trying to set it back to 1 or 2, but I don't know how to make it stay like that. Every time I refresh the page, it goes back to zero! Please help!

    Somehow, my Referer Header settings got set to 0 (zero). Because of this, I'm getting an error message on certain sites. I found out that I could reset it to 1 (one) or 2 (two) if I browsed to about:config and typed in the new value, but it doesn't seem to be working. I'm not sure how to "save" this setting, and ever time I refresh the about:config page the setting goes back to zero. Plus, I'm still getting the error messages on the sites I was having trouble with.

    You need to connect the iPod to your computer with iTunes and then restore the iPod via iTunes on the computer.
    Also see:
    http://www.apple.com/support/ipodtouch/getstarted/

  • Sharepoint 2013 and SSRS how to send reports on date schedule after dw load completes

    Certainly with subscriptions we can generate a SSRS report on a schedule like say every Monday morning at 5 AM PT.   My problem is I want to run those reports but I want to make sure the Datawarehouse completed its load first.  Example if
    for some reason the DW breaks at 4 AM and does not finish the load the Reports should not run.  ONce the DW is finished then reports should run.  The 5 AM is really a place holder for 1st attempt to send reports.  It should keep trying until
    it can send them or Tuesday comes around.
    the only approach I can think of is via the DW with a job and stored procedure you could have it exec anything you want.  Is it possible to exec the reporting services report from sql?  Is there a way from within sharepoint?
    Ken Craig

    Hi Ken,
    According to your you want to fire the SQL Server Reporting Services after the Data Warehouse load data completed, right?
    By default, when a subscription is created, a corresponding SQL Server agent job is created meanwhile. The SQL Server agent job has the same schedule with the shared schedule or report-specific schedule that is using by the subscription.
    The corresponding SQL Server agent job calls stored procedure AddEvent to add an event in SSRS. Then the SSRS notification service fetches the event from SSRS database to deliver the subscription.
    That, we can configure regular shared schedule or report-specific schedule based on the irregular schedule. So in your scenario, you can configure the job steps to fire the subscription after the Data Warehouse load data completed. For the details, please
    refer to the links below.
    http://social.msdn.microsoft.com/Forums/en-US/32bc6d2d-5baa-4e27-9267-96a4bb90d5ec/forum-faq-how-to-configure-an-irregular-schedule-for-report-subscription?forum=sqlreportingservices
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • How to send an automated email notification after dataloads complete.

    Please search the forums before posting
    Hi ,
    Hoq can we send an automated email notification once the daily data loads are complete.
    All the data loads are done through PC and after these got complete daily we need to send an automated e mail saying the loads are completed.
    Request your replies.
    Edited by: Arun Varadarajan on Mar 10, 2009 9:22 AM

    Hi,
    check this threads/links:
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/9bdd42cadf2878e10000000a155106/frameset.htm
    Process chains and Email alerts?
    process chain Email Notification
    E-mailing functionality on a process chain
    If you search SDN you will find much more...
    Regards
    Andreas

  • How to send 0-bit confirmation file after the original file upload finished

    Hi All,
    We are using Receiver FTP adapter (FTPS, FTP over SSL) to send/upload a Idoc file to external partner FTP server.
    Along with the IDOC file to be uploaded, and as soon as the IDOC file upload is finished, we will need to upload a 0-bit "confirmation file", thus indicating that the (main) file upload has finished.
    For example, if the IDOC file is named        example.idoc
    the confirmation file has to be named        example.idoc.cnf
    We are thinking to use "Run Operating System Command After Message Processing". Can someone give us more information if we can use this? if so what would be the command line??
    Thx
    N@v!n

    Hi,
    ok - to this solution: if you want to use (it would be possible), you must create repository objects for this (flagfile) and also directory objects.
    but other solutions:
    a, you can create a script in target system and call this script from the adapter (which would create a file)
    b, I'm not sure if there is a command for creating a file, but there is defe=inetely one for copying it. So what about storing some ampty file in location /template/ for example and call cp command from the adapter? and you would place this copy to required location
    Peter

  • How to send notification to IM client?

    Dear all,
    When a client receives a mail - audio or video mail, the client needs to be notified?
    How is this achieved?
    Rgds,
    Seetesh

    Yes I agree. But there must be some service provider who does the forwarding of messages provided it has the valid email addres and the IM Gateway information.
    The Gateway of different IM clients along with their port nos can be configured using a Factory and then checking the email address, the service provider can relay back the messages present for that user on that IM.

  • How to send e-mail to many user one time

    I would like to send e-mail BCC to hundred people using one e-mail only
    How to I set the code to BCC? I don't want to make a for loop to send the e-mail hundred times.
    I know the following code can set the mail BCC to ohter person
    msg.setRecipient(Message.RecipientType.BCC,email);
    but if I want to BCC to hundred people, how should I revise the code ?

    javax.mail
    Class Message
    public void addRecipient(Message.RecipientType type, Address address)
         throws MessagingException

Maybe you are looking for

  • My device wont come up when i plug it into my computer

    When i plug my 4S into my computer it doesnt conect with my itunes. How can i make itunes be able to read it?

  • Exposure to SAP FI

    Hello, I met a financial professional today who has never been on SAP, but would like to acquire some exposure to SAP.  Because I am an ABAP developer, I know that it is possible to download trial versions to practice your skills.  How can somebody g

  • How to view attachment directly in Formscentral?

    Is there a way to view attachments directly in FormsCentral without having to download it - sort of like a preview button?  Also, why does it only prompt you to save the file, instead of just open it right away.  It's slightly cumbersome to have to s

  • Language Translation - Polish

    Hello, I'm new to macs and find it really nice that there are language translation widgets, and also an option in sherlock. I haven't been able to find one that translates english to polish and polish to english. I've done some looking, and will cont

  • Holding readings for certain period of time

    LabVIEW beginner here. I'm logging particle count data generated every second from two identical instruments, one upstream of a substrate and the other downstream; they are labelled alpha and beta respectively in the attached VI. The counts plus pene