【发布时间】:2015-07-08 10:13:41
【问题描述】:
我是 Android 开发新手,希望您能帮助我。
我在 Linux 中使用 android studio 来开发一个 UPnP 应用程序。 在我的电脑上,有 2 个网络,1 个通过 eth0 连接到互联网,另一个通过 eth1 连接到私有网络。
当我启动我的应用程序时,它可以找到位于网络中连接到 eth0 的 UPnP 服务器,但找不到连接到 eth1 的服务器。
通过查看Setting up Redirection through the Emulator Console,我找到了一种将网络从端口 1900 重定向到 Android 模拟器的方法,我的应用程序现在可以在专用网络中找到 UPnP 服务器。
Android Console: type 'help' for a list of commands
OK
redir add udp:1900:1900
OK
redir add udp:51844:51844
OK
redir add tcp:80:80
KO: can't setup redirection, port probably used by another program on host
问题是无法将协议 tcp 从端口 80 重定向到流视频。
我的问题是:
1- 有没有办法告诉 android 模拟器监听 eth1 而不是 eth0。或者如果可能的话,同时收听 eth0 和 eth1。
2- 如果没有,我如何重定向端口 80 以便通过我的应用流式传输视频?
感谢您的帮助。
【问题讨论】:
标签: android-studio android-emulator upnp