Find which application is using a port...

Is there a way to find out the application that is using a port? (Pure Java or JNI)
Also, I would like to know the protocol being used on the port, is that possible?

Hi,
as mentioned before my ejb. I think it is the best approach to use a command line approach from java using the "netstat" and read the standar output stream and parse it according to your need
something like that; it is up to your implementation to parse the output from the standard stream
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class Main {
     public static void main(String[] args) throws InterruptedException, IOException {
            Process process = Runtime.getRuntime().exec("netstat -a");
            InputStream is = process.getInputStream();
            InputStream err = process.getErrorStream();
            BufferedReader bri = new BufferedReader(new InputStreamReader(is));
            BufferedReader errReader = new BufferedReader(new InputStreamReader(err));     
            Thread t1 = new Thread(new StreamEmptier(bri));
            t1.start();
            Thread t2 = new Thread(new StreamEmptier(errReader));
            t2.start();
            process.waitFor();
     class StreamEmptier implements Runnable {
          private BufferedReader reader;
          public StreamEmptier(BufferedReader reader) {
               this.reader = reader;
          public void run() {
               String line = null;
               try {
                    while ((line = reader.readLine()) != null) {
                         System.out.println(line);
               } catch (IOException ioe) {
                    ioe.printStackTrace();
               } finally {
                    try {
                         reader.close(); // close the stream
                    } catch (IOException ioe) {
                         ioe.printStackTrace();
               }// finally
     }Regards,
Alan Mehio
London,UK
Edited by: alan_mehio on 15-Dec-2008 18:37

Similar Messages

  • How can I find which applications are using the most power?

    I have recently noticed a full charge of power doesn't last as long as it used to on my iPad 2.  Is there some way to determine which applications are using the most power?
    I have been monitoring my home network router accesses and have noticed the iPad logs accesses every 15 seconds.  This only happened recently.  It had been well behaved and only accessing once or twice a day before.  I installed the most recent iTunes upgrade, per suggestions during a Sync.  The problems seemed to occur after this update.  I have gone through all the settings and have minimized the applications requiring higher power (I switch off the location services unless I'm away from home.  Likewise, I turn off my cellular carrier unless I'm away from home, etc.)
    In short, how can I maximize my power usage (aside from turning it off)?
    Thanks.
    Dave

    Thanks for responding so quickly.
    I'm really trying to find out why the battery is depleting much faster than it used to all of a sudden.  I used to be able to put a full charge on it and it would last about 5 to 6 days with normal use (normal for me).  Now that battery only lasts about 2 to 3 days with the same use.
    I DO recharge it when it needs to be charged but this is indicating there is something else (new) that is causing the power drain.

  • How can we find out which application is runing UDP port 69?

    Whenever I run Cisco Network Assistant on my Windows 7 computer, I receive "The embedded TFTP server cannot start".
     netstat -an|more shows “udp 0 0 0.0.0.0:69 ...” How can we find out which application is runing UDP port 69?
    Bob Lin, MCSE & CNE Networking, Internet, Routing, VPN Networking, Internet, Routing, VPN Troubleshooting on http://www.ChicagoTech.net How to Install and Configure Windows, VMware, Virtualization and Cisco on http://www.HowToNetworking.com

    These ones may help.
    Have you ever wanted to see which Windows
    process sends a certain packet out to network?
    Process
    Monitor v3.1
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • How to know what reports are running by looking at SSReproting Services to see what reports are running and also any clue of which application is using the reporting services?

    How to know what reports are running by looking at SSReproting Services to see what reports are running and also any clue of which application is using the reporting services?

    To see what reports are running, take a look at the execution log views that are available in the database.  Which views that are available are dependent on your version of SSRS.
    http://technet.microsoft.com/en-us/library/ms159110.aspx
    To see which application is using SSRS is a little more difficult.  You can turn HTTP logging on, which will give you an idea of where connections are coming from, so you can see IP addresses.  You can also look at the execution log view to see
    user accounts.  So, depending on your environment and use of service accounts, this could be easy, or difficult.
    http://technet.microsoft.com/en-us/library/bb630443.aspx
    If all else fails you can look for clues in the SSRS logs.  Good luck...

  • How to find which datasource are using  tables AFRU ,CAUFV and AUFM

    *how to find which datasource are using  tables AFRU ,CAUFV and AUFM*

    Hi,
    You can enter your table names in SE11 transaction and click "Display" and again click "Where -Used-List". Then it will show all the places where these tables are used(Datasources)
    Hope this helps.....
    Regards,
    SUman

  • Which application to use?

    Can you tell me which application was used to create the ProBehance video? And this video:
    http://www.youtube.com/watch?v=By0DtXck-SE&list=UUPGbCDe_4SLPidUlNYTXmVg&feature=share&ind ex=3

    That's a combination of photography, motion tracking, and 3-D. This can all be accomplished in After Effects CC or you could use any compositing or 3-D program. It's not a plug-in, or a single click, or software magic.

  • E63 - knowing which application is using WiFi

    Hi folks, I have a question, is there a way to know which application is using WiFi?
    I have the Wifi icon on the right upper corner but have no clue as to which app is using it. 
    Any ideas?
    Also, can you recomend a good task manager? 

    If you "long-press" the Home key you get a list of apps running in the background. Turn them off one by one and you'll get to it.
    mc13

  • How to find which datasource is using table JCDS?

    How to find which datasource is using table JCDS?

    Hi,
    Please find the below link and identify whether will it meet your requirement or not ... If it meets your requirement then I can provide you more documents related to the same which we have in our project.   We were using the same for Plant Maintanance project...
    For this report the required information is gathering from the different data sources from the ECC system. This report requires object status functional location attributes, Equipment attributes and some specific information apart from normal transaction data for an order.
    u2022     Main feeding data sources for this report are 2LIS_17_ORDER and 2LIS_18_ORDER.
    u2022     Requires the object status data (system status, number object status and un-number system status) is feeding from different DSO where the status data is staging with different data flow.
    u2022     Requires the Order planned end date which is dependent on the operation  planned completion date. so we are feeding this field from Operationu2019s DSO where the planned date is staging with different data flow.
    u2022     Required characteristic data and attributes of the Functional location  is getting from the master data .The 0FUNCT_LOC is updating by master data data sources
    u2022     Required standard class  of the functional location is updating from other DSO where the  classification  data is staging with the help of different data flow.
    2LIS_17_ORDER and 2LIS_18_ORDER Data flow Details : No enhancement was done for these data sources .
    Status Data Flow Details:
    The status data is staged because ,this dat is required for the reports based on the Orders, Operations , Notifications, Functional Location and Equipment.
    To load suitable data to different DSOs from the Status DSO we maintain the Filters for status profile and status at DTP level.
    Required status change dates  are deriving based on changed on date ,system status while loading from status DSO to Order DSO.
    The system status ,Number object status and un- numberd object status are feeding from status DSO only.The status DSO is updating by u20180TE_OBJ_STATUS_HISTu2019.This Is based on the tables JCDS,JSTO and T000.
    JCDS     MANDT     =     JSTO     MANDT
    JCDS     OBJNR          =     JSTO     OBJNR
    T000     MANDT     =     JCDS     MANDT
    This DS has enhanced for the below  two fields
    1.     Order Number
    2.     Operation/Activity Number
    The Logic to populate the above two fileds is as below.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/e4/1522bae6aa46b8802dca454e846d58/frameset.htm
    regards
    BVR

  • Can't load Facebook on Firefox . Suspect malware/trojan. Downloaded 3 free scan/remove programs, all end in .exe and my Mac wants to know which "Application" to use to run them. Help?!

    Firefox 3.6.19
    Mac OS 10.4.11
    attempted the''' 3 free options''' listed here
    http://support.mozilla.com/en-US/kb/Firefox%20never%20finishes%20loading%20certain%20websites?s=cannot+load+page&as=s
    when I click on any of them, they don't just open/run. they want to know what application to use to open them. do these work for my Mac, or is there another free alternative?
    Here's what the Mozilla page above said
    Firefox never finishes loading certain websites
    If specific websites (not all) start to load, but never finish (i.e. The Firefox activity indicator may spin for several minutes, or the status bar may show "Done" on a blank page), it is either because of a software trojan called Vundo, or a file being in the wrong format.
    Table of Contents
    * Vundo trojan variant
    o Search for malware
    o More help
    * JavaScript file format
    Vundo trojan variant
    A variant of the Vundo trojan is known to cause Firefox to have problems loading certain high-traffic sites, including Google, Yahoo, MySpace, Facebook, and more.
    Search for malware
    Not all variants of the Vundo trojan can be detected or removed by malware scanners. However, you should scan your computer for infections first:
    * Run the Microsoft Malicious Software Removal Tool.
    * Run a full system virus scan with something other than your normal program:
    o A '''free solution online is Kaspersky's online scanner'''.
    * Run a full system spyware scan with something other than your normal program:
    o MalwareBytes' Anti-Malware
    o '''SUPERAntiSpyware''' is known to detect many variants of Vundo, and has a free version.
    o '''Spybot S&D''' is a well-known free solution.
    More help
    If you're having a problem loading sites other than the one described above, see the Error loading websites article to see if it addresses your problem. You can also check your Internet security software - resetting permissions for Firefox can often fix similar problems.
    There can be other causes of the symptoms described above. Before attempting these instructions, try the methods described in the Basic Troubleshooting article to see if they will address your problem.
    If you still have problems after scanning, you may ask a support question.

    It sounds like you may have multiple problems, but none of them are likely to be caused by malware.
    First, the internet-related issues may be related to adware or a network compromise. I tend to lean more towards the latter, based on your description of the problem. See:
    http://www.adwaremedic.com/kb/baddns.php
    http://www.adwaremedic.com/kb/hackedrouter.php
    If investigation shows that this is not a network-specific issue, then it's probably adware. See my Adware Removal Guide for help finding and removing it. Note that you mention AdBlock as if it should have prevented this, but it's important to understand that ad blockers do not protect you against adware in any way. Neither would any kind of anti-virus software, which often doesn't detect adware.
    As for the other issues, it sounds like you've got some serious corruption. I would be inclined to say it sounds like a failing drive, except it sounds like you just got it replaced. How did you get all your files back after the new drive was installed?
    (Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.)

  • How to find which Query is using program AQ10MM==========Z6============

    Hi,
    I wanted to know how to find out which SAP query uses this program. AQ10MM==========Z6============
    I tried with SQ01/02 but was unable to get it. Can you please help.
    Regards,
    Mukund S

    In my installation , it is usually AQZZ"usergroup"========QUERYNAME======
    You could see if you have a user group 'MM' or '10MM' in SQ03 and set the user group if available.. then in SQ01, see if you have a query called Z6
    Also try out this function module RSAQ_DECODE_REPORT_NAME to see if it would give you the user group and query name...

  • How to find which user is using the index?

    Hi All,
    I have an index named 'CTXT_ITEM_CODE' . The Index _type is Domain. When i try to drop this index its telling ORA-00054: resource busy and acquire with NOWAIT specified error
    now i need to find out which session is using this index, so that i can kill it and drop the index.
    Thanks

    SELECT c.owner,
           c.object_name,
           c.object_type,
           b.SID,
           b.serial#,
           b.status,
           b.osuser,
           b.machine
      FROM v$locked_object a, v$session b, dba_objects c
    WHERE b.SID = a.session_id AND a.object_id = c.object_id
    AND c.object_name='CTXT_ITEM_CODE';
    ALTER SYSTEM KILL SESSION '<sid, serial#>'

  • Changing Application that uses FTP port 21

    We have a Windows server that uses an OCR software that allows our printers to scan documents to our Mountain Lion server to a document management application (at least thats what we are trying to do). The problem is that the OCR software is sending it to an FTP share but will not let you specify the FTP port number. By default Mac uses port 21 and I know how to change that port to something else. I just need to know if there is a way to let another application take control of port 21?

    Sure.  Shut off the ftp server on the target system. 
    At most there can be one application listening to a particular TCP port.  If you don't want that to be ftp, shut it off.
    But I'd tend to doubt that'll help, here.
    I'd be interested in learning a little more about how this OCR tool works and how this file transfer supposedly happens, as ftp is a paragon of insecurity and also largely incompatible with modern network security and firewalls, but this particular request for a changed-port seems quite unexpected. 
    The identity of the OCR software might help, as a look at the documentation would be interesting, too.

  • How can I find which font is used inside a PNG?

    Hi,
    When I started my company, I had a company logo and website designed for me by another company.  This company doesn't exist anymore and all I have left are the source files of my logo and website.  They delivered me the logo in PNG format.  I am trying to make different sizes and shapes of my logo, but when I open the PNG file in Fireworks (CS5), it says that the font is missing, so whether I want to replace the font or keep appearance.  How can I find out which font was used in the original PNG file?  When I select the text, the font selection box is empty, so I cannot see which font was originally used...
    Thx,
    Steven

    Hi Linda,
    I tried it and you are right.  I kept trying to preserve the appearance.  Never tried the replace fonts option! 
    Thank you very much for your help!!
    Steven

  • How to find which applications are running

    I cannot figure out where on the HD to look to see which apps on my iMac are open.
    Other than the ones highlighted in the dock, can there be others open?
    I was ejecting my external HD and a message reads 'it is in use, try quitting applications'.
    As far as I can see, I have quit them.

    Every application that is open goes into the dock and has a blue light under it until the application is closed.... if that application is not added to the dock, then the icon just disappears...
    If application is added to the dock, then when you end the program the little blue light under the icon disappears.
    Cheers

  • How to find which custom program uses authorization checks

    Hi all,
    I have been asked to find out which custom ABAP program in our organization is using Authorizations checks and which is not.
    Since there are thousands of custom programs I will need to automatize this process somehow.  But I am not an ABAP expert and I will need some help.
    Could any of you give me an idea of what would be the best strategy to find out if authorization objects/checks exist in a number of ABAP programs?  (would a simple text search do?).
    Many thanks,
    Aldo

    If you are looking out for Authorization related to Execution of any program, then look for entries in table TRDIR where field SECU (Authorization Group) is not blank.
    Below SAP documentation may help you:
    Authorization Group
    Authorization group to which the program is assigned.
    The assignment of a program to an authorization group plays a role when the system checks whether the user is authorized to:
    Execute a program
    --> Authorization object S_PROGRAM
    Edit a program (-Include) in the ABAP Workbench
    --> Authorization object S_DEVELOP
    Programs that are not assigned to an authorization group are not protected against display and execution.
    Security-related programs should, therefore, always be assigned to an authorization group.
    Report RSCSAUTH can also be used to assign programs to authorization groups. This report is documented in detail.

Maybe you are looking for

  • Blocage PSE 13

    Bonsoir je découvre et  utilise depuis peu PSE 13. aucun message d erreur ne m'a été renvoyé  lors de l intallation. toutefois des la première tentative d utilisation, le logiciel à l édition d'une photo c est bloqué et ne repond à aucune commande. a

  • It keeps saying i must connect to the internet when i install it but i am connected any help?

    ?

  • Error in uploading ".exe" file in KM

    hi, i have created a content repository for the E-Learning using WEB-DAV protocol. I amusing IIS as an http system where my webdav repository is mapped. this repository is mapped with a folder "hrms" in KM. I am unable to upload exe file in my webdav

  • Equity section of balance sheet missed

    hi. what are the steps to add equity section in the balance sheet report?is it in the report painter through GRR2?thank you.

  • Is 1080i ok with 1080i 30p?

    I shot a project where the wild life was shot with a Sony Z7U in 1080i 30p (a menu setting) and the interviews were shot in 1080i 29.97.  I capture my footage with a Kona AJA Lhi card in DVCPRO HD so the clips come in as 1280 x 1080 (1.5)   It appear