查找未使用的IP地址 [英] Finding unused IP addresses

查看:391
本文介绍了查找未使用的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图寻找这一点,但什么也没遇到什么,我需要这么远。我为Android编写一个FTP服务器应用程序,但我不知道该怎么找到那个未使用的服务器的IP地址。

I have tried searching for this, but nothing has met what I need so far. I am writing an FTP server application for Android, but I do not know how to find an IP address for the server that is not in use.

我迄今已猜测和在地址硬编码。有时它会工作,有时不会。我怎样才能让我的应用程序始终如一地并连接到一个开放的,可用的IP地址?

I have so far been guessing and hardcoding in an address. Sometimes it would work and sometimes it wouldn't. How can I get my app to consistently generate and connect to an open, usable IP address?

谢谢!

推荐答案

标准的解决问题的方法是获得一个DNS名称(通常是在一个小的费用),然后使用动态DNS服务都跟DNS托管服务提供商的当前IP地址的DNS名称。
然后,客户机可以从一个众所周知的名称查找您的IP地址。

The standard solution to the problem is to obtain a DNS name (usually at a small expense), and then use a dynamic DNS service to keep telling the DNS hosting provider the current IP address for the DNS name. Then clients can lookup your IP address from a well-known name.

有也是间接地解决这个问题。你可以得到一个基础设施提供商来托管FTP服务。例如,您可以运行一个免费的Amazon Web Services的微实例。虽然它在运行它应该是在一个恒定的IP地址。随后双方你的客户和你的应用程序可以使用这个作为一个固定的中间中继点。这也解决了可能不会提供给在一个特定的时间响应的移动设备的瞬时性质

There is also an indirect solution to the problem. You can get a infrastructure provider to host the FTP service. For example, you could run a free Amazon Web Services micro instance. Whilst it is running it should be on a constant IP address. Then both your clients and your app can use this as a fixed intermediate relaying point. This also solves the transient nature of mobile devices which might not be available to respond at a particular time.

这篇关于查找未使用的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆