473,320 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting the right IP address when multiple are present

!NoItAll
297 100+
Ok - I have a socket library that allows me to pass data around a network. The basic design is that I send a request to the service for the data I want and include my return address (my IP address) where I am waiting for the answer.
The "return" address is the IP address of the machine from where I send the request, and where I expect the service on the other end to return the requested data.
Here's my issue. On some computers there are multiple IP addresses. This happens when a user is running a VPN, or if there are more than two NICs installed. It's easy to get all of these IP addresses, but only ONE is the correct one to send to my service. While VPNs typically are going to be the last one in the list, second NICs can be in any order.
My question is: What do others do to address this issue?

A couple of ideas I've had are:

1. Compare the IP addresses with the IP address of the server to see which one is "closest" to the server address numerically.

2. Force the user to tell the client which IP address to use for it's return address.

3. Rely on the DNS - but in some networks this just doesn't seem to be reliable.
Oct 13 '12 #1
0 1796

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jason | last post by:
Sorry for the post here but could not find an Exchange newgroup. I developed an application a year or 2 ago that sends SMTP email. The application allows the user to customize the text from...
2
by: Marcus | last post by:
I have seen many posts of people with the same problem as me (attached below), but I have yet to see any solutions posted. Has anyone figured out how to deploy an Asp.net web site to the webserver...
2
by: Praveen | last post by:
Hi All, I have made a webservice in C# and it works fine in my machine. I ran into a crazy problem when I wanted to deploy it in windows 2003 server. I have run "aspnet_regiis.exe -i" to make...
0
kaleeswaran
by: kaleeswaran | last post by:
hi!!! i was getting ip address of my local machine in my network using jsp. can i get all of my local machine address which is connected in the network...? if so give me some idea about...
4
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Why am I getting an error when I passed by ref a dataset to a new form? The message reads "cannot convert from 'ref Paimport.unixAccount' to 'ref System.Data.DataSet'. Paimport is the name of the...
4
by: Daniel | last post by:
is there some per-process-limit on memory in .net processes? is there any way to increase it? i keep getting System.OutOfMemoryException when my box has 8 gigs of unused memory.
16
by: poojabawa | last post by:
getting error 404 when using HttpWebRequest
1
by: Omendra | last post by:
I am getting an error When i am going to convert my SP as dynamic Error : Msg 403, Level 16, State 1, Line 21 Invalid operator for data type. Operator equals add, type equals text. Code : ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.