How to prevent executing more than one client from a machine?

Hi all,
Currently I am doing a client server project in java. The client is java swing. There is a requirement to prevent executing more than one client from a machine.
Now I am relying on socket for this. I listen to a port, say 15000 and when the second session is started it would give an exception at the socket. I know that this a trivial method. Can anybody please suggest a better method. Also is it possible to bring focus to already executing client, if the user tries to execute the client program again in the same machine?
An early answer to this question is highly appreaciated.
Thanks in advance
SSM

Thanks for the suggestion, but I dont think we can use socket for this. And again if we use file for the same as you described, I think it would sometime create a some serious side effects. Suppose after one client session is invoked, the power goes off. In this case the client shut down is not in the normal sequence and hence we cannot remove the file programaticaly. This creates big problem when the user tries to run client again.
I am really interested to know, is there any standard way in java which can be used to achieve this. Also is it possible to give focus to already executing client program if the user tries to invoke the client again.
Thanks
SSM

Similar Messages

  • How can I select more than one song from the search results?

    I want to create playlists based on certain words in the song title. For example, I may want to create a playlist of all my songs with LOVE in the title.
    Doing the search is easy, but I can't select more than one song at a time. Is there any way in iTunes 12 for Windows to do this? I found an answer in iTunes for Mac, and it basically says to "un-check "Search Entire Library." " but I don't see that option in iTunes for Windows.
    Here is the link to that question: how can i select more than one song from drop down search bar
    I hope some Windows user can help me out.

    Found the "Search Entire Library" option - click on the small (VERY small for my eyesight) down arrow next to the magnifying glass. Also need to select "Filter by: Songs", and then the songs in the main window show the results.
    I'm going to leave this up on the board because 1) in case someone else has this question, and 2) I don't know how to delete it anyway.

  • How can i transfer more than one file from server to client

    Hi,
    our requirement is transfer more than one files from server to client using the
    webutil_file_transfer.as_to_client_with_progress.One file transfer is already working in our system.If anybody know the solution please inform
    regards
    mat

    just an idea ...
    for this purpose let us put aside security concerns and other potential problems....
    -- Get the content of a server directory with Filter and create zip file
    1) create a class that implements java.io.FilenameFilter ...
    2) define accept() method ...
    3) call File.list() with the filter as a parameter. The returned array of strings will have all the names that passed through the accept() filter
    4) use java.util.Zip to create ZIP file on the server side
    -- I think it is better to create this functionality as a separate Java class, put it in required folder and after it
    -- use Forms->Program->"Import Java class" to create pl/sql wrappers, than to create wrappers for all classes and code in pl/sql
    5) use webutil to transfer file on the client
    6) use Java on client side to unzip transferred file
    if you think this is not too complicated, you should try ...
    Regards,
    Vladimir

  • How can i sync more than one folder from My Pictures to my iphone 4?, how can i sync more than one folder from My Pictures to my iphone 4?

    Hi,
    how can I sync more than one folder of pics from My Pictures on my computer to my iphone?

    http://support.apple.com/kb/HT4236

  • How to bring the more than one rows from the table into the script

    Hi
    I have to bring more than one rows from the table into the Main windows of the script. so plz help me out.
    Thanks in Advance
    Ananya

    Hi Ananya,
       Bring more than one row into main window of script.
       For this you need to do some changes for data which you pass to main window.At a time you need to pass more than one row,so for this you need to define one structure.See below code.
    Types:begin of ty_rows,
         include structure (your row_structure),
         include structure (your row_sturcture),
    Types:end of ty_rows.
    for example....
    If i need to pass 2 vendor details at a time to main window then the structure should be like this.
    Types:begin of ty_rows,
           vendor1 like lfa1-lifnr,
           vendor1_name like lfa1-name1,
           vendor2 like lfa1-lifnr,
           vendor2_name like lfa1-name1,
          end of ty_rows.
    Data:i_main type standard table of ty_rows,
         wa_main type ty_rows.
    Based on condition you can pass more than one rows of your actual internal table data to i_main internal table.
    Then you can pass i_main internal table to your main window.
        I think this will help you.
    Cheers,
    Bujji

  • How can i select more than one song from drop down search bar

    sometimes to make a playlist i will search my music library for a word & then add all the songs with that word in the title
    the drop down search bar will not allow me to select more than one song
    or
    will it?  & i just can't suss out how... maybe you know?
    if so, please tell me~!!!
    thank you

    hey i tried that before i posted this question... i tried all of the normal ways one would use to select more than one item...
    any click of any kind at all takes you out of the search drop down & into the main itunes window... where you are deposited back into the songs alphabetically... no longer are you seeing the results of the search...
    sigh
    at the risk of sounding like one of those people, the "old" itunes did not have this problem...
    grrrr... it seems to be that pesky drop down menu~ if only you could see the search results in the main list as opposed to only in the drop down thing

  • How can we select more than one item from LOV in Query_Find form?

    Hi,
    I have a requirement i.e i want to select more than one customer number seperated by comma from the customer number lov field in the query_find form.How can we write the code for this requirement?
    and after clicking find it has to display notification form which contains the details of customer which you selected from Custome query_find form.
    Could you please help me out.
    Thanks in Advance,
    Dhana

    Found the "Search Entire Library" option - click on the small (VERY small for my eyesight) down arrow next to the magnifying glass. Also need to select "Filter by: Songs", and then the songs in the main window show the results.
    I'm going to leave this up on the board because 1) in case someone else has this question, and 2) I don't know how to delete it anyway.

  • How do I email more than one photo from my library?

    I can select and email one photo at a time to a contact but I'd like email more than one at a time so that the receiver doesn't receive multiple emails containing just one photo, can I do it and how? Thanks

    Hi. From the Photos App, tap the Arrow in the top tight corner. Select up to 5 photos by tapping, a check mark will appear on selected photos. Tap the Share icon in the top left corner and select "eMail"
    Also, if you need more than 5 photos attached you can use multi-tasking to go back to Photos App, find the additional photo(s) tap and hold for approx2 seconds and select "Copy". Then go back to your email and paste the new image.
    Stedman

  • How do I manage more than one Ipod from the same computer?

    I just bought my boyfriend an Ipod and I want to set it up for him before I give it to him. We only have one computer and I'm not sure what to do. Can we both work from one itunes or can I install it twice?

    Just plug it in.
    You do not need to install iTunes twice.
    See this -> How to use multiple iPods on one computer

  • How can servlet serve more than one client's socket links when tomcat start

    I have done this in the servlet's 'init' method:
    while (true)
    Socket sk = server.accept ();
    new ServerThread (sk).start ();
    but tomcat STOPPED at this point! The webapp didnot even been installed. But I want to show the index.jsp pages of the webapp, the code above only running at background. How can I do that?

    Eeeew... what are you doing there? Of course Tomcat stops. You have an infinite loop, and accept() blocks until someone actually connects.
    And a servlet shouldn't be using sockets anyway. This is most ugly, and possibly against the J2EE specs.

  • How do you delete more than one item from download folder at a time?

    I have been trying to clean out my downloads folder which has gotten too full.  Mostly audiobooks which are now in iTunes and photographs that I have received from family and friends.  I can drag them one at a time into the trash, but was hoping there is a faster way.  If not, I will do this slowly.  My understanding is that if the file is saved somewhere else, deleting it from the downloads folder doesn't delete it from my mac, right?
    Thanks,
    Laverne's Mom

    One more question, am I correct in assuming that if I delete something from the downloads folder, even an application I have downloaded (I have a program that converts photos to cross stitch patterns and I don't want to delete it) that the application will not be deleted from my computer?
    Laverne's Mom
    That is probably a correct assumption. However it's always a good idea to double check before trashing something. Let's use the App (that's what programs are called on Macs) for cross stitch patterns. Check the Applications folder and if you see the app there it's fine to trash it from your downloads folder. Even if you goof once it's in the trash  you can get it out of the trash assuming you haven't emptied the trash. Open the trash folder, right click the item and select Put Back. If you are not using Snow Leopard (10.6.x) then you can drag the item back to where it was originally.

  • How do you return more than one value from a method?

    say I have this:
    public static int myFunc(String inString)
         // I want to return two values from this method
    }yeah so how would i do that?

    If the two values are somehow related--like a person's name and his age--define a class that has those two values as member variables--for example, Person. But only if that class and the assocation of those two quantities makes sense as an entity in your program. Don't do it just to jam to quantities into one return.
    Or, if the two values are two of the same thing--person A's age and person B's age--then you can return an array or Collection.
    If it doesn't fit either of those two scenarios, then your method is trying to do too much unrelated stuff and you should break it into multiple methods. For example, calculating a Person's age based on his birthdate and today's date and calculating his Body Mass Index based on his height and weight. Those two quantities should NOT be returned together.

  • How do you burn more than one song from my Logic on to a CD?

    I have like five songs done that I want to burn on one CD at one time. When I bounce a song I seem to only burn one song. Thanks for the help

    Hi,
    bounce the songs to iTunes, create a playlist and burn the CD with iTunes. Nice, smooth workaround for Logic Express users.
    You could also use third party burn software (free or expensive)
    But if you want to spend some money, i suggest upgrading to Logic Studio, which contains Waveburner.
    Fox

  • How to email more than one photo from camera roll

    How do e-mail more than one photo from the camera roll at a time?

    Go to the camera roll, open the thumbnails, click on the arrow in the top right, select up to 5 photos, click on share in the top left and select email.

  • Execute more than one times external command of OS Windows NT

    Hi all,
            I have to execute more than one times from an ABAP program an exernal command of Operating system windows NT . In order to reach this goal I found the standard program RSBDCOS0 and it works very well if you execute it one time.  Unfortunately I have to execute this external command more than one times. Is there any soluiton?
    thank to all
                        Gino Bonfiglioli

    Well why are you using this report RSBDCOS0 to execute external commands?
    Because SAP provides certain function modules that can be used to call operating system commands; so you can use these functions to do your task.
    Just check the following link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fa/0971e1543b11d1898e0000e8322d00/frameset.htm
    As you mentioned that you need to execute multiple times, you can easily put the call to function module inside a loop or do/enddo structure. for example consider the following
    do 3 times.
    call function 'SXPG_COMMAND_EXECUTE'                           
          exporting                                                 
               commandname                   = 'Put operating system command here'          
               additional_parameters         = full_filename        
               targetsystem                  = targtsys  
               stdout                        = 'X'                  
               stderr                        = 'X'                  
               terminationwait               = 'X'                  
          importing                                                 
               status                        = sxpg_status          
               exitcode                      = sxpg_exitcode        
          tables                                                    
               exec_protocol                 = sxpg_results         
          exceptions                                                
               no_permission                 = 1                    
               command_not_found             = 2                    
               parameters_too_long           = 3                    
               security_risk                 = 4                    
               wrong_check_call_interface    = 5                    
               program_start_error           = 6                    
               program_termination_error     = 7                    
               x_error                       = 8                    
               parameter_expected            = 9                    
               too_many_parameters           = 10                   
               illegal_command               = 11                   
               wrong_asynchronous_parameters = 12                   
               cant_enq_tbtco_entry          = 13                   
               jobcount_generation_error     = 14                   
               others                        = 15.                  
    write the results
    loop at sxpg_results.
    write:/ sxpg_results-length,
             sxpg_results-message.
    endloop.
    refresh sxpg_results.
    enddo.

Maybe you are looking for

  • Free for a Day apps - Legal to use in Configurator?

    Today, several paid apps we have our eyes on to purchase for use on our classroom iPads through the VPP program are available free for the day, so I downloaded them and installed them in Apple Configurator, where they indeed show up as being free in

  • Log apply service in 10g dataguard

    Very Good Morning to all ; I  have a doubt when applying redo data at standby site. (MAXIMUM PERFORMANCE) In physical standby database ,  I know , Redo Data is applied from  standby redo log (real time apply )  or  archive redo log ( redo apply)   1)

  • Creating 3d geometry from 2d

    hi! I am new to java3D but I am making investigation to see if it will fit my needs. I need to make very small 3d-viewer with possibilities of rotate/zoom/pane simple geometry objects. I checked out some tutorials and available viewers, but there are

  • File to multple Idocs based on souce values

    Hi, I have the below requirement. Flat file to Idoc scenario Current scenario: Flie has n B records, so n Idocs are generated New Scenario Flie has n B records, so n Idocs are generated. In addition, If material starts with 4* and plant = xxxx, then

  • Can I make DVD with out themes appearing in it

    Thank you for helping. I'm just a young kid living in an old man's body fighting with his first computer. My goal is to make a DVD (from IMOVIE) without any themes in it, but can't find way to simply burn the disc without going thru a theme. Thanks 4