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

x
?
Solved

TCP/IP Port Data Capture

Posted on 2002-03-26
9
Medium Priority
?
1,241 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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 …
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

715 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