Can I tell within my server code that a client vm has connected?

I have some server-side code and would like to modify the code path based on whether a client is connected and debugging or not. For example:
if (!isClientDebugging())
  doSomething();
else
  doSomethingElse();So what would go in the isClientDebugging() method? I could do something very ugly like attempt to connect to myself and if that failed due to the port not being available I could assume a client is connected. But I have to think there's a better way.

What are you trying to achieve? My client/server system uses simple socket communication. A client can connect to a server and send messages to the server. A client can change the logging state (e.g. "fine for debugging") of the server by just sending a custom command. My server holds references for each client that connected, so the server knows how many (and therefore if at all) clients are connected. If a client disconnects the server will remove it from it's list. If the client crashes the server removes it from its list the next time it pushes a message to all clients because it gets an exception for each client the is not connected anymore.
see http://java.sun.com/docs/books/tutorial/networking/sockets/index.html

Similar Messages

  • How can I see all the Transaction Code that the client is using?

    How can I see all the List of Transaction Code that the client is using?

    Hello Sugauli,
    Did you mean to ask
    transaction types the client is using?
    instead of
    transaction code
    If so, go to SPRO (in ERP system) and follow this path:
    Sales and Distribution -->
         Sales -->
             Sales Documents -->
                 Sales Document Header -->
                      Define Sales Document Types
    All the transaction types that are not used have an X in the column Block.
    Easwar Ram
    http://www.parxlns.com

  • Can you tell within the form with javascript if the file has reader rights.

    Hi
    I have an issue where I need to know at runtime if the current file has reader rights so that a link will directed them to one place or another.
    I was hoping with javascript I could check if the form has reader rights
    or
    the file name will be different for the version with reader rights so the other option is with javascript can it tell me filename of itself.
    Thanks
    Brad

    Hi,
    there is indeed a method to check usage rights.
    Here is a folder level script to check those rights.
    You should be able to use this also in a script in your form.
    LiveCycle Blog: Dateien auf Verwendungsrechte hin überprüfen//Check files for Usage Rights
    Hope this helps.

  • Can anyone tell me the server settings that allow me to use tesco mail?

    I use Tesco.net mail but the it has stopped working because of the server settings. Either I cant send or receive mails. What should the settings be?

    So go to tesco.net and check their helptext or contact customer service there :) Or try google "imap server tesco net"

  • I forgot the passcode to turn off restrictions. I have restored my iPad back to the factory settings and then synced it with the latest backup. The restrictions are still on and it is asking for the passcode. Can someone tell me how to get that off.

    I forgot the passcode to turn off restrictions. I have restored my iPad back to the factory settings and then synced it with the latest backup. The restrictions are still on and it is asking for the passcode. Can someone tell me how to get that off.

    The only option is to wipe the device clean and restore it to factory settings.  Hope you have a backup.
    Follow the instructions in  iOS: How to back up your data and set up your device as a new device http://support.apple.com/kb/HT4137 to restore the device to factory settings.
    Once you have setup the device as a new one, you can then sync it back with your iTunes account and all your music, apps, contacts and any other content sync'ed with iTunes will be loaded on the device. Any content that is stored only on the device and not sync'ed with iTunes, like app logins or data, will be lost during this process. Be forewarned that this is a long process and can take a couple of hours or more to complete. This can be painful, but it is necessarily so to prevent users from working around the security settings. After the restore is complete, you can setup a new Restrictions passcode. Make a note of the passcode to avoid this situation in future.
     Cheers, Tom

  • Can you tell me what this code does?

    Can you tell me what this code does?
    import java.io.*;
    class Assignment1
    public static String[][] tdi = {     {"Paris", "418", "Rome", "55"},
                             {"Liverpool", "121", "Copenhagen", "35"},
                             {"Liverpool", "418", "Paris", "50"},
                             {"Liverpool", "553", "Frankfurt", "55"},
                             {"Frankfurt", "553", "Budapest", "50"},
                             {"Amsterdam", "121", "Madrid", "65"},
                             {"Amsterdam", "418", "Paris", "35"},
                             {"Madrid", "121", "Stockholm", "90"},
                             {"Budapest", "553", "Warsaw", "30"},
                             {"Copenhagen", "121", "Amsterdam", "35"},
                             {"Rome", "418", "Amsterdam", "60"},
    //--Start Method--
    public static void main( String args[] ) throws IOException
    System.out.println("Welcome to NoWings Airline.");
    InputStreamReader input = new InputStreamReader(System.in);
    BufferedReader keyboardInput = new BufferedReader(input);
    System.out.println("Please enter the airport you wish to depart from:");
    String[] info = TDIDLL.searchDest( keyboardInput.readLine() );
    if (info == null)
    System.out.println("Sorry, no plane to this destination");
    else
    System.out.println(info[0]+" departing at platform "+info[1]); }}
    public static String[] searchDest( String dest )
    String[] result = null;
    for(int i = 0; i < tdi.length; i++)
         if (tdi[1].equals(dest)) {
         result = new String[2];
         result[0] = tdi[i][0];
         result[1] = tdi[i][2];
         return result;
    return result; }
    // Info Method //
    // Fly Method //
    // Exit Method //
    Thanks. Also, can you tell me where I have gone wrong in the code.
    Much appreciated.

    Can you tell me what this code does?Why don't you run it and find out for yourself?

  • Can anyone tell me in simple terms that acutally work how to cancel my purchase of extra icloud space

    can anyone tell me in simple terms that acutally work how to cancel my purchase of extra icloud space.

    Welcome to Apple Support Communities
    To downgrade the iCloud storage to free storage, see > http://support.apple.com/kb/ht4874
    If you want to get a refund, you can do it during the first 14 days after purchasing iCloud storage. To do it, contact with the iCloud support > http://www.apple.com/support/icloud/contact

  • I now have two iPads and have opened a new icloud account.  I need to change one of the ipads to the new account.  Can you tell me how to do that?

    I now have two iPads and have opened a new icloud account.  I need to change one of the ipads to the new account.  Can you tell me how to do that?

    Welcome to the Apple Community.
    settings > iCloud, scroll down and delete account. Re-enter the details of the new account.

  • My purchased download of Photoshop Elements did not work and I have been trying to reach a real person at Adobe.  Has anyone ever been able to do that.  If so can you tell me how to do that.

    My purchased download of Photoshop Elements did not work and I have been trying to reach a real person at Adobe.  Has anyone ever been able to do that.  If so can you tell me how to do that.

    Hi vision4success ,
    I would like to gather some information regarding your issue, So, please answer the questions below:
    What is the exact issue that you are facing?
    Do you get any error while installing Photoshop element?
    What is the Operating System that you are using?
    Since when you are facing this problem. Has it ever worked for you?
    What all steps did you try from your end?
    If you have any other details regarding the issue that might help us, please feel free to mention that as well.
    Waiting for you reply.
    Regards,
    Sarika

  • Every time I open my imovie app on my computer it always closes.  can someone tell me why it does that?  i already checked for updates but there is none.

    Every time I open my imovie app on my computer it always closes.  can someone tell me why it does that?  i already checked for updates but there is none.

    I would suggest trashing your iMovie Preference file. Complete instrucitons are here.
    https://discussions.apple.com/docs/DOC-4061

  • I am having a 3gs 8gb and can anyone tell how i could confirm that whether my iphone is factory unlocked or jailbreak??

    i am having a 3gs 8gb and can anyone tell how i could confirm that whether my iphone is factory unlocked or jailbreak??

    It sounds like you are most likely going to need a hardware repair.  If the phone is still in-warranty, you should be able to do this pretty easily by contacting AppleCare at 1-800-My-iPhone (1-800-694-4766) or taking your phone to an Apple Retail Store.
    The surest way to find out if an issue is software related is to restore the phone as a new device via itunes, then when prompted to choose between restoring from a backup and setting up as a new device, go ahead and disconnect the phone and test it before choosing one of those two options.  If the issue still occurs at this point, its not software related and the phone will need to be repaired.  However, if it did resolve the issue, you can plug the phone back into your computer and you will be prompted with the same options again, and may continue to restore from your available backup.
    Hope this helped!

  • Having trouble figuring out how to forward text messages.  Can someone tell me how to do that?  Where the forward button.  You used to be able to hit forward and put radio button on all the messages.  The screen looks blank to me.

    In the new iOS7, Having trouble figuring out how to forward text messages.  Can someone tell me how to do that?  Where the forward button.  You used to be able to hit forward and put radio button on all the messages.  The screen looks blank to me.

    In the new iOS7, Having trouble figuring out how to forward text messages.  Can someone tell me how to do that?  Where the forward button.  You used to be able to hit forward and put radio button on all the messages.  The screen looks blank to me.

  • HT5622 .mac mail - I still use my .mac email address to access itunes, icloud, etc. Every once in a while, apple sends me confirmation, reservation, etc. emails to the .mac address. Can someone tell me how to access that email account?

    .mac mail - I still use my .mac email address to access itunes, icloud, etc. Every once in a while, apple sends me confirmation, reservation, etc. emails to the .mac address. Can someone tell me how to access that email account?

    Hi pjerl,
    Depending on when you originally set up your Apple ID, you may have @mac.com, @me.com, and @icloud.com email addresses associated with your account, but all mail sent to those addresses should still come in to the same iCloud account (you can test this to make sure by sending yourself emails at those addresses). You may find the following articles helpful:
    iCloud: About your @icloud.com, @me.com, and @mac.com email addresses
    iCloud: Using your @icloud.com email address
    Regards,
    - Brenden

  • Can you tell me what Error code 2721 is?

    Can you tell me what Error code 2721 is? And how do I work around this.

    Can you tell me what Error code 2721 is? And how do I work around this.

  • Mobile Me  is set for my Ipod and I want it set for my IPhone. Can anyone tell me how to get that done?  How can I do the switch?

    Mobine Me is on my Ipod and I am trying to switch it to my IPhone  to no avail. Can anyone tell me how to do that switch?

    Welcome to the Apple Community.
    I assume you mean iCloud.
    Just enter the same details you used on youriPod into your phone (settings > iCloud).

Maybe you are looking for

  • Configure Apple TV through MacBook Pro?

    Is there a way to configure Apple TV through the MacBook Pro? I'm trying not to buy another remote.

  • Regarding % in Pivot view

    Hi Experts, We have a requirement we have built the following snapshot report with a PIVOT table in OBIEE Answers We would like to show the margin % in the column The formula for this is (Margin/Sale)*100 .. But we are unable to implement it in PIVOT

  • Payslip on ECC6 using EP7 for country grouing 40

    Hi, My requirement is to create a Payslip in Smartform for country grouping 40. For that, I have copied the International form in HRFORMS into country group 40. I was able to active 'ABAP Dictionary Structure' and 'SAP Smart form' but while activatin

  • How can i download indesign for osx 10.5.8 in trial version?

    I have an iMac with OSX 10.5.8 and i'd like try the trial version of inDesign. Where can i find the appropriate version and how can i dawnload it? Thanks Shantam

  • Sabrix related configuration in SAP system

    Can anyone let me know, what are the necessary configuration we need to do in SAP system to use Sbrix for the tax calculation?