Solved

TCP/IP Port Data Capture

Posted on 2002-03-26
9
1,212 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
[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
  • 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
Independent Software Vendors: 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: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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

739 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