Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TCP/IP Port Data Capture

Posted on 2002-03-26
9
Medium Priority
?
1,262 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 225 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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

885 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