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
Solved

TCP/IP Port Data Capture

Posted on 2002-03-26
9
1,199 Views
Last Modified: 2013-11-13
Hi,
     I need to be able to capture data from a app that gets data from a server on a tcp/ip port. I tried winsocks but I get an error trying to listen to a port that is in use. There must
Be some way to capture the string data from that port so I can use it in my program. Any help would be great.

Thanks
Mark
0
Comment
Question by:ShockWave
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:baltman
ID: 6897603
Well, the only thing I can think of right now, is that you change the port number on the application you are trying to capture data from. Once you did that, the port is available for you to use  and capture/manipulate the data. If your other application still needs the data, you could configure your winsock application to send the data it just received to the application's new port and it should be fine....

What are you specifically trying to do? With some more details, the experts migt be able to do a little more....

hope this helps!

BA
0
 
LVL 2

Expert Comment

by:polygon
ID: 6897620
If the port is used by another app, you have to change it...

If not, you are most probably forgetting to close it. So the first time you start your app, it works but then when you stop it (ot get some error), the port does not get closed and each time you try again, you get port in use error.

the only way to get going again is to restart the machine and take care of closing the port at the end of your program...
0
 

Author Comment

by:ShockWave
ID: 6897661
Thanks for the responses I can not change the apps port number it is not my app.. What I am trying to do is capture data that is going to the app so I can search the data for flagged keywords.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:baltman
ID: 6897736
Well, I think we got some bad news for you in that case, because if an address and port are in use, you can not open it in VB's WinSock Control...

You could do some re-routing of that app's data by setting routes on the port number to your winsock application and then let your winsock application re-route it to the application. You could use a simple firewall (TCP Mapping) for that...if you have the ability.

BA
0
 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6898324

Sounds like you need a packet sniffer.  Two applications cannot bind to the same port on the same machine.  I think I remember seeing some rudimentary packet sniffer on

http://www.planetsourcecode.com

Good luck!
0
 

Author Comment

by:ShockWave
ID: 6900064
CodeWizrd,
     I downloaded a packet sniffer and it captured all the data that I needed but could not find any source code or info on a packet sniffer. If anybody has any info
On packet sniffer links for info on how to code a packet sniffer program or actual sorce code you will get the points.  Thanks Again CodeWizrd.
0
 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6900350

Shockwave,

I went back and took a look and was unable to find any vb source for a packet sniffer.  I did find, however, source for one written in C for Windows.  Here is the link:

Download:
ftp://ftp.maticad.it/pub/misc/ntsniff.zip

Info:
http://www.freecode.com/projects/ntsniff/?topic=37,175,248,255

Hope this helps...

Rich

0
 
LVL 1

Accepted Solution

by:
CodeWizrd earned 75 total points
ID: 6900369

Oops

Shows me that I should check my links before I post them...

This page:

http://www.tlsecurity.net/windows/ids/sniffer/

Shows info and links to multiple packet sniffers for windows.  2 of them (including ntsniff from above) include source code.

Rich
0
 
LVL 1

Expert Comment

by:CodeWizrd
ID: 6900378
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This video teaches viewers about errors in exception handling.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

808 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