Let me see if I understand the question: You have a software server
runing that accepts a socket connection. You want to know if the
connection came in on your ethernet card A or your ethernet card B,
correct?
No, I have a hostname. I create an endpoint with that hostname and
port. I connect directly to that. (I could get a list of IPs that
the hostname gives, and then use one of them, as well, but I don't, I
just use Socket.Connect direct to the hostname + port). Now, I want
to know to which IP did I connect to? Using that IP, I want to get
the hostname of that IP. This is not necessarily the same hostname
that I used to connect, since that original hostname could
'forward' (I don't know the proper terminology, sorry) to a bunch of
other hostnames / IPs. And this is what I want to know.
Are you using tcpListener? Or are you using raw Sockets to manage the
connection? What is the class/tool you are using, because that will
determine how we can best answer you.
I am using:
Socket socket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
socket.Connect(hostName, port);
Is this what is called raw sockets?
Thanks for your reply,
Zytan
(Btw, Jon already answered my main question in another post.)