How can I know a port being used or not

Hello, I have a trouble, I don't know how to realize whether a port has been used or not.
For example, I have some command:
ServerSocket server1 = new ServerSocket(2001);
ServerSocket server2 = new ServerSocket(2002);
ServerSocket server3 = new ServerSocket(2003);
ServerSocket server4 = new ServerSocket(2004);
I wonder how I can realize the fact that server1, server1, server3 or server4 is avalable?
Please help me. Thank you.

Maybe you misunderstood my question. Not in the slightest. I answered the question you asked.
The fact is that you asked the wrong question. You asked about ports in use. You're now asking how to know if a Socket is active. That's a different question. A port is different from a socket, and they're both different from a connection.
To answer that new question, Java provides Socket.isClosed(), Socket.isConnected(), etc.
But note that all these APIs can do, in any language, is tell you what you have personally done with that Socket instance, in the current application. So actually these APIs are formally redundant: all they do is just maintain a few booleans recording what methods have been called. What they don't do, and can't do, in any language, is tell you about the state of the connection. Only reading or writing can do that.

Similar Messages

  • How can i know the port of my database?

    hello,
    how can i know the port of my database is working in?
    ty

    user11933068 wrote:
    I don't know how to do this, sorry
    :-(TNSNAMES.ORA is used by the client to resolve an alias to an actual server/listenr port/db service name.
    TNSNAMES.ORA is found, by defualt, on the client machine at $ORACLE_HOME/network/admin
    Here's how it works:
    Suppose I have this in my tnsnames.ora:
    fubar =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = btzlkfp)
      )So, my connect string would look something like this:
    $> sqlplus scott/tiger@fubarTNS will take the name 'fubar' and look it up in the tnsnames file. In my example, it will then route the connection request to 'myhost' (using other net services to resolve that to an actual IP address), and place the request on port 1521 at that server. The listener will pick that up and see that scott wants to log on to database 'btzlkpf'.
    There's more, but at this stage I want you to understand the connection between what you enter for your connect string and the database itself.

  • How can I know the database is using Cost Based or Rule Based?

    Hi all expertise,
    How can I know the database is using Cost Based or Rule Based?
    If cost based it is using, what methods are need to use to minimize the cost when database is running? And which tables I can see the performance of the database?
    Thanks
    Amy

    how to see database setting ?
    use this
    SQL> sho parameter optimizer
    NAME TYPE VALUE
    optimizer_dynamic_sampling integer 1
    optimizer_features_enable string 9.2.0
    optimizer_index_caching integer 0
    optimizer_index_cost_adj integer 100
    optimizer_max_permutations integer 2000
    optimizer_mode string CHOOSE
    choose means if table statistics is available then it will use cost
    else
    use rule based optimizer
    for seeing performnace of table use
    set autotrace on
    and run your query
    if it doen't show cost.it means it use rule based
    for using cost based
    u will calculate table statistics
    9i
    dbms_stats.gather_table_stats('owner','table');
    8i
    analyze table <table_name> compute statistics;
    hope it will help you
    kuljeet pal singh

  • How can I know which file is using by the self-service workflow?

    Dear all:
    In my directory, there are two HRSSA.wft and How can I know which source is using by the workflow of the self-service ?
    my environment is oracle 11.5.9 | self-service 4.1 | workflow builder 2.6
    Thanks
    regards
    Terry

    One way would be to download the HRSSA workflow to a wft file (using the WFLOAD utility - see MOS Doc 578248.1), then comparing this downloaded wft file with the two files you have (using a utility such as diff in Unix). The comparison that reports no differences will identify the wft that was uploaded into the database.
    HTH
    Srini

  • I have an iphone 4s i used to USA, when i come in Haiti it and put anothe sim card it asks me to activate.  i cannot activate it. how can i know if it's unlocked or not?

    i have an iphone 4s i used to USA, when i come in Haiti  and put another sim card it asks me to activate it.
    i cannot activate it. how can i know if it's unlocked or not?

    As Kilted Tom said, make sure that you speak with your previous provider.  ATT will direct you to a website and have you enter in some information which will determine if you qualify for the unlocking status.  After you complete that, you will need to restore your phone as new through iTunes.  Make sure that you have a backup to iCloud in order to retrieve your content and data after you restore your device.

  • How can we know one transaction is enhanced or not ?

    how can we know one transaction is enhanced or not ?

    first find enhancements related with a perticular tcode using following prog. :
    *& Report  ZUSEREXIT                                                   *
    report zuserexit no standard page heading.
    tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.
             tables : tstct.
    data : jtab like tadir occurs 0 with header line.
    data : field1(30).
    data : v_devclass like tadir-devclass.
    parameters : p_tcode like tstc-tcode obligatory.
    select single * from tstc where tcode eq p_tcode.
    if sy-subrc eq 0.
       select single * from tadir where pgmid = 'R3TR'
                        and object = 'PROG'
                        and obj_name = tstc-pgmna.
       move : tadir-devclass to v_devclass.
          if sy-subrc ne 0.
             select single * from trdir where name = tstc-pgmna.
             if trdir-subc eq 'F'.
                select single * from tfdir where pname = tstc-pgmna.
                select single * from enlfdir where funcname =
                tfdir-funcname.
                select single * from tadir where pgmid = 'R3TR'
                                   and object = 'FUGR'
                                   and obj_name eq enlfdir-area.
                move : tadir-devclass to v_devclass.
              endif.
           endif.
           select * from tadir into table jtab
                         where pgmid = 'R3TR'
                           and object = 'SMOD'
                           and devclass = v_devclass.
            select single * from tstct where sprsl eq sy-langu and
                                             tcode eq p_tcode.
            format color col_positive intensified off.
            write:/(19) 'Transaction Code - ',
                 20(20) p_tcode,
                 45(50) tstct-ttext.
                        skip.
            if not jtab[] is initial.
               write:/(95) sy-uline.
               format color col_heading intensified on.
               write:/1 sy-vline,
                      2 'Exit Name',
                     21 sy-vline ,
                     22 'Description',
                     95 sy-vline.
               write:/(95) sy-uline.
               loop at jtab.
                  select single * from modsapt
                         where sprsl = sy-langu and
                                name = jtab-obj_name.
                       format color col_normal intensified off.
                       write:/1 sy-vline,
                              2 jtab-obj_name hotspot on,
                             21 sy-vline ,
                             22 modsapt-modtext,
                             95 sy-vline.
               endloop.
               write:/(95) sy-uline.
               describe table jtab.
               skip.
               format color col_total intensified on.
               write:/ 'No of Exits:' , sy-tfill.
            else.
               format color col_negative intensified on.
               write:/(95) 'No User Exit exists'.
            endif.
          else.
              format color col_negative intensified on.
              write:/(95) 'Transaction Code Does Not Exist'.
          endif.
    at line-selection.
       get cursor field field1.
       check field1(4) eq 'JTAB'.
       set parameter id 'MON' field sy-lisel+1(10).
       call transaction 'SMOD' and skip first   screen.
    THEN check into each enhancement whether any one has been changed.
    Pls reward if usefull
    S@meer

  • How can i know the servlet is running or not?

    Hi all,
           I have a doubt regarding servlet. I created one servlet and deployed in server. Now i called (RUN) the servlet from the browser. And it is running. Now can i know that the servlet is running or not in the server without seeing in the browser. Can we know the status of the servlet with its URL in the server whether it is running or not?
             Let me explain my problem. In my servlet it will run continously read one table and  do some operation depending on the entries in that table. Now i called the servlet from the browser. After some time i closed the browser. If browser is there i can know whether servlet is running or not. But now how can i know that servlet is running or not. Becoz eventhough we closed the browser the servlet will run in the background. How can i achieve this?
    Thanks and Regards,
    VJR.

    Hi!
    With first call, the servlet will be loaded, and it remains so until server-shutdown, but you need a timer-mechanism execute method calls continuously.
    Regards,
    Thomas

  • How can we know the OSCOLECTOR is running or not.

    Hello all,
    I want to know how can we know about the the OSCOLECTOR is running or not?
    tell me the way to at os level for unix and linux and R3 level.
    Thanks in advance.
    Atul

    HI,
    AS I WORK ON WIN 2003 , U CAN CHECK WHETHER OSCOL IS RUNNING OR NOT FROM THE OS LEVEL AS;;;
    GOTO SERVICES.MSC AND CHECK FOR THE OSCOL SERVCIE. IF IT IS NOT RUNNING THEN START IT.
    AND THEN CHECK FROM THE SAP LEVEL.
    DEFINITELY IT WILL WORK.
    REGARDS,
    BHUPESH

  • How can i know my webac.xml effect or not?

    I'm trying to configure web access control for my groupwise webaccess, but the access control list is not effect.
    I checked on the webaccess console, only some configurations is affected.
    how can i know my webac.xml effected? with my check, it is not.
    WebAccess Configuration File /var/opt/novell/groupwise/webaccess/webacc.cfg
    LDAP Configuration File /var/opt/novell/groupwise/webaccess/ldap.cfg
    Dictionary Configuration File /var/opt/novell/groupwise/webaccess/dictionaries.cfg

    Hi
    The webac.xml is a bit flacky in the shipping GroupWise 2012. As far as I know there are several bugs logged for it. This should improve with SP1 shipping in the next few months.
    In the meantime you might want to open an SR and get newer code from Novell.
    Cheers,

  • I have more than one version of GR5 on my mac. How do I know which is being used by logic 9?

    Hi, I'm new to logic pro and would realy appreciate some help. I have several versions of guitar rig 5 on my mac. How do I find out which one is being used in logic.
    I looked in plugins and see a version that is only 109 mb but I have another that is over 500 mb on my desktop. Can I just drag and drop this into plugins folder?
    Sorry if I seem a bit stupid but I can't make out what is being used as the one called up in logic seems to be the full version.
    Thanks

    The presets from earlier versions of GR should all be in the same place anyhow.. so reinstalling GR5 into it's correct locvation shouldn't affect anything regarding those other presets. In fact, as far as I can recall.. GR5 should ask if you want to import older presets when you first run GR5 standalone (The app version of GR5 in your applications folder) after install....
    Then those same presets should be present in in the AU version of GR5....
    Also GR4 (So long as you updated it to the latest version via the Service Center) should also continue to work with Logic Pro anyhow.. and load when you load an older project which used that version....
    Finally, any version you may have installed elsewhere.. won't work with Logic Pro because LP uses the AU Component version that is installed by the NI installer and therefore located in your components folder...  Those other versions are more likely to be copies of the standalone version.. which LP9 doesn't use.

  • How can I prevent breadcrumbs from being used on the first page?

    Hi,
    I'm using the latest version of the technical communication suite to produce a WebHelp
    layout from a framemaker book. Thanks to all the help I've received so far it's proceeding
    well, although slowly.
    II have an initia l'home'  page, that isn't present in the TOC, just with a program logo, a company
    logo and a helpdesk address. How can I stop breadcrumbs from appearing on this page?
    I'm happy for this to be the Home page and to keep the word Home, and it is a separate
    document in the linked framemaker book.
    Has anyone got any ideas as to how I can do this?
    Thanks in advance for your help.
    Best wishes,
    Karen

    Hi Karen
    To each his or her own. Jeff's approach certainly will work but will require you to repeat the process each time you generate. With the approach I outlined you would only need to do things once.
    As for the breadcrumbs not appearing at all, it depends on *WHERE* in the Master Page you elected to add them. In order for the approach I outlined to work, you need to ensure you add the placeholder *OUTSIDE* the Body placeholder. Then you should see breadcrumbs on the pages you have associated with the Master Page.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • How can I know which orb im using?

    Hello all
    im trying to move from javaIDL to jacORB in my application
    I point my class path to the jacORB.jar and it is first in the list
    how can I be sure im using jacORB and not javaIDL ?
    Because the declaration is the same in the code. (import org.omg.CORBA.ORB;)

    You need to set ORB properties.
    Not fammiliar with JacORB but Orbix case looks like:
    Properties props = new Properties();
    props.put("org.omg.CORBA.ORBClass", "IE.Iona.OrbixWeb.CORBA.ORB");
    props.put("org.omg.CORBA.ORBSingletonClass", "IE.Iona.OrbixWeb.CORBA.singletonORB");
    orb = ORB.init(args, props);
    Anyway, check JacORB docs.
    found this:
    p.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
    p.put("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton");
    Message was edited by:
    algr

  • How can i know if DAQ hw support "buffered task" and "Sample Timing Hw"?

    Hi,
    i'm choosing the corrent DAQ hw for my application. I read in the NI-DAQmx documenation that if would use the DAQmxRegisterEveryNSamplesEvent(..) function, the hw should support the "bufferd tasks". How Can i know what DAQ device support this feature? Then, I know not all the DAQ device support the "Sample timing hardware". How can i know what DAQ hw use this timing type? Does the NI PCI-6220/6221 support these features?
    Thanks in advace.
    PS: sorry .. but i'm new of "NI World".

    All of the Multifunction I/O (MIO) products, including the PCI-622x products, support hardware timing and buffered analog input tasks.
    In general, if a product's specifications include the analog input sample rate (e.g. "up to 200KS/s") then that means the product supports hardware timing and buffered analog input.
    --Joe

  • To check weather JAVAVM being used or not?

    Hi,
    We are in the process of cleaning up unnecessary components. As a part of this, first of all we are checking weather JAVAVM is being used or not?  How to confirm weather JAVAVM is being used or not?
    I gone through Database Feature Usage but could not find any entry related to JAVAVM, for rest of the components i was able to. Any hints on this.
    DBA_REGISTRY
    COMP_ID
    COMP_NAME
    VERSION
    STATUS
    MODIFIED
    CATALOG
    Oracle Database Catalog Views
    10.2.0.5.0
    VALID
    23-JUN-2013 06:16:06
    CATPROC
    Oracle Database Packages and Types
    10.2.0.5.0
    VALID
    23-JUN-2013 06:16:06
    JAVAVM
    JServer JAVA Virtual Machine
    10.2.0.5.0
    VALID
    23-JUN-2013 06:16:07
    CATJAVA
    Oracle Database Java Packages
    10.2.0.5.0
    VALID
    23-JUN-2013 06:16:07
    And features usage is as follows.
    Database Feature Usage
    NAME
    DETECTED_USAGES
    ASO native encryption and checksumming
    0
    AWR Report
    17
    Advanced Replication
    0
    Advanced Security
    0
    Audit Options
    41
    Automatic Database Diagnostic Monitor
    6
    Automatic SQL Execution Memory
    41
    Automatic Segment Space Management (system)
    41
    Automatic Segment Space Management (user)
    41
    Automatic Storage Manager
    0
    Automatic Undo Management
    41
    Automatic Workload Repository
    1
    CSSCAN
    0
    Change Data Capture
    0
    Change-Aware Incremental Backup
    0
    Character Semantics
    0
    Character Set
    41
    Client Identifier
    0
    Data Guard
    0
    Data Guard Broker
    0
    Data Mining
    0
    Database Replay: Workload Capture
    0
    Diagnostic Pack
    0
    Dynamic SGA
    0
    EM Database Control
    0
    EM Grid Control
    0
    Extensibility
    41
    File Mapping
    0
    Flashback Database
    0
    Internode Parallel Execution
    0
    LOB
    41
    Label Security
    0
    Locally Managed Tablespaces (system)
    41
    Locally Managed Tablespaces (user)
    41
    Locator
    0
    MTTR Advisor
    0
    Materialized Views (User)
    41
    Messaging Gateway
    0
    Multiple Block Sizes
    0
    OLAP - Analytic Workspaces
    0
    OLAP - Cubes
    0
    Object
    41
    Oracle Database Vault
    0
    Oracle Managed Files
    0
    PL/SQL Native Compilation
    0
    Parallel SQL DDL Execution
    24
    Parallel SQL DML Execution
    0
    Parallel SQL Query Execution
    35
    Partitioning (system)
    41
    Partitioning (user)
    0
    Protection Mode - Maximum Availability
    0
    Protection Mode - Maximum Performance
    41
    Protection Mode - Maximum Protection
    0
    Protection Mode - Unprotected
    0
    RMAN - Disk Backup
    0
    RMAN - Tape Backup
    0
    Real Application Clusters (RAC)
    0
    Recovery Area
    0
    Recovery Manager (RMAN)
    0
    Resource Manager
    0
    SQL Access Advisor
    0
    SQL Tuning Advisor
    7
    SQL Tuning Set
    41
    Segment Advisor
    40
    Server Parameter File
    5
    Shared Server
    37
    Spatial
    0
    Standby Archival - ARCH
    0
    Standby Archival - LGWR
    0
    Standby Transmission
    0
    Streams (system)
    0
    Streams (user)
    0
    Transparent Gateway
    0
    Tuning Pack
    0
    Undo Advisor
    0
    Virtual Private Database (VPD)
    0
    XDB
    0
    D
    Regards
    DBA.

    We are in the process of cleaning up unnecessary components. As a part of this, first of all we are checking weather JAVAVM is being used or not?  How to confirm weather JAVAVM is being used or not?
    Yes - if you have an Oracle database the JVM is being used.
    There is NOTHING to 'clean up' as far as the internal JVM that is part of Oracle.
    You can NOT modify it or upgrade it. And if you remove it Oracle will also remove your database.
    See the Database Installation Guide
    http://docs.oracle.com/cd/B28359_01/install.111/b32002/remove_oracle_sw.htm#CCHBABDE
    In the Inventory screen, select the Oracle home and the products that you want to remove, then click Remove.
    Note:
    If you choose to remove Oracle JVM, Oracle Universal Installer removes all installed products that depend on Oracle JVM, including Oracle Database 11g.

  • Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal, How can i know whether my phone is in use??

    Hi anybody there who can help me ha..? My phone 5s was stolen 1 month ago..Find my phone is no a big deal bcz it seems to be wiped out all data including settings. it might be in use somewhere turning new fresh Gadget.  How can i know whether my phone is in use??

    You would know for a fact if the device is in use, but if you go back to the find my iPhone app in iCloud.com, you can either select to erase it, or place it in lost mode, in which case, once the device makes a connection to the internet, it will automatically go into that mode.

Maybe you are looking for

  • Not able to create sales order  using BAPI - BAPI_SALESORDER_CREATEFROMDAT2

    Hi Experts, I am not able to create sales order . I am using BAPI - BAPI_SALESORDER_CREATEFROMDAT2 to create sales order .I am passing external sales order number to the parameter SALESDOCUMENTIN. I am getting following error. "524   |Only quantity 1

  • How to remove base64 from SaveAsSVG

    This is building from the script I was developing that is mentioned here, http://forums.adobe.com/thread/1052584. As my script loops through and converts EPS to SVG, I am consistently getting large amounts of base64 encoding in the SVG which is unece

  • How to access Time Capsule 2013 disk from Windows 7

    I have seen several (older) threads that suggest that you can access the Time Capsule disk from Windows 7 using Windows Explorer and navigating to \\Time-Capsule-Name.  However, I have tried this repeatedly and just cannot get it to work.  Could this

  • Calendar Blues

    My first impressions of the iPad calendar is that it is easily the worst calendar app I have ever used. There seems to be no way to edit events once created. It is not an iOS problem since the iPhone calendar is easily edited, but an iPad problem. Is

  • IMAC color calibration

    Looking calibrate: Imac 24 "intel Core 2 Duo, Intel Core 2 Duo IBookPro 15" and a new Imac 21"all with Snow Leopard and Windows 7 Home Premium (Bootcamp). What would be the best option (hardware and software) to obtain the correct calibration between