Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Detect the connection direction (incoming or outgoing)

Posted on 2005-04-21
3
Medium Priority
?
366 Views
Last Modified: 2010-05-18
Hi ,

I was create a monitor TCP/UDP connection program and work fine.I'am interesting to add a new field (direction) that show if one connection was established by a local PC or by a Host PC.The informations that I' have are:

Local IP:        ex. 192.168.01
Local Port:     ex. 1569
Remore IP:    ex. 192.168.07
Remote Port: ex. 80
State:            ex. CLOSED , LISTENING , SYN_SENT , SYN_RCVD , ESTABLISHED , LAST_ACK , CLOSING , etc..

For retrive the connections I use GetTcpTable and GetUdpTable.Can anyone help me to find the solution ?

Thanks !

0
Comment
Question by:Marco_Panza
1 Comment
 
LVL 26

Accepted Solution

by:
Russell Libby earned 2000 total points
ID: 13846081

Marco,

Sorry to be the bearer of bad news, but the short of it is that you can't determine this. Stream oriented sockets are bi-directional, and once connected there is nothing to tell you who the client is, and who did the listen/accept (server side).

Regards,
Russell
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month20 days, 14 hours left to enroll

864 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