Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TCP/IP Ports

Posted on 1999-06-21
10
Medium Priority
?
541 Views
Last Modified: 2010-04-06
Hi there. How Can I detect all TCP/IP ports which are busy wiht antoher job?
I've go Delphi 4.0. Is there Delphi 5.0?
Cheers, howec.
0
Comment
Question by:howec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 17

Expert Comment

by:inthe
ID: 1383997
Hi
search on www.av.com for "wsockets.zip" ,there will be one result and i think the example of that may help you.i remember looking at it the other day and remember  an example of tcp ports
Regards Barry
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1383998
I don't know a way to enumerate all ports that are in use and scanning all ports one by one is not what you want (I guess). There are just to many possible ports.

Epsylon.
0
 

Author Comment

by:howec
ID: 1383999
For example, how can I scan a port num 5000?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:yk030299
ID: 1384000
I am not sure if it works! :-)
Try to bind the port#5000 to a clientsocket
If it is not able to set active=true, it was active already!
0
 
LVL 4

Expert Comment

by:Radler
ID: 1384001
Lookin at Win9x I found a file named "services" inside this there are a list with the service "officialy" registered.
At Win NT the mechanism is identical


0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1384002
This example tries to open a port for listening. If the port is already in use it raises an execption.


This example will raise an exception when run in Delphi but it won't when run stand-alone:


var ServerSocket1: TServerSocket;


  ServerSocket1 := TServerSocket.Create(Self);
  ServerSocket1.Port := 5000;
  try
    ServerSocket1.Active := true;
  except  //
    ShowMessage('Port in use');
  end;
  ServerSocket1.Free;
  .....

0
 

Author Comment

by:howec
ID: 1384003
bu I need stand-alone...........
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 1384004
I think I did not explain that correctly. The code will work eighter way: With or without Delphi.
The only thing is that when you run it in Delphi an anoying request will pop up. That's all.
0
 
LVL 7

Accepted Solution

by:
jconde earned 800 total points
ID: 1384005
Hi, download the following application

TCPSTAT at
http://www.torry.ru/apps/apps/tcpstat.zip

this application is pretty much the same as the netstat.exe console app and full Delphi 4 source is included.

Regards,

Jorge
0
 

Author Comment

by:howec
ID: 1384006
That's what i need. Thanks JConde.
Sorry epsylon, I  tried your example but it didn't detect back orffice port: 31 337. Sorry......

Cheers howec.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question