绑定到127.0.0.2 [英] Bind to 127.0.0.2

查看:149
本文介绍了绑定到127.0.0.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows XP PC上本地运行客户端/服务器应用程序,并且为了测试目的,我想运行多个客户端。



服务器有一个配置文件包含可以连接的客户端的IP地址;在现实世界中,这些都将在具有单独IP地址的单独主机上。



目前我可以使用绑定到127.0.0.1的单个客户端进行本地测试因为我在服务器配置中只能有一个客户端-IP映射(这就是系统如何工作,不能重新设计!)我只能在我的开发PC上运行一个客户端。



我试图启动绑定到127.0.0.2的另一个客户端应用程序连接到绑定到0.0.0.0的服务器,但是服务器认为客户端再次从127.0.0.1连接,因此拒绝它认为是第一个客户端的第二个连接。



任何人都可以建议一个方法来解决这个问题?我相信我可以再运行一个客户端绑定到PC的外部IP地址,但我真的想能够运行多个。



我知道我可以使用VirtualBox或类似的,以运行新的实例,但我想所有的客户端应用程序在Visual Studio调试器中运行。



任何帮助非常感谢!

Nick。



PS。

解决方案

您可能可以创建更多的环回接口。查看所选答案如何创建虚拟网络界面?


I'm running a client/server application locally on my Windows XP PC and for testing purposes I want to run multiple clients.

The server has a configuration file containing the IP addresses of the clients that can connect; in the real world, these would all be on separate hosts with separate IP addresses.

Currently I am able to test locally with a single client which binds to 127.0.0.1 however because I can only have one client-IP mapping in the server configuration (that's how the system works and can't be redesigned!) I can only run one client on my development PC.

I've tried to start another client application bound to 127.0.0.2 connecting to the server which is bound to 0.0.0.0 however the server thinks that the client is connecting from 127.0.0.1 again and so rejects what it believes is a second connection from the first client.

Can anyone suggest a way to get around this problem? I believe I could run one more client bound to the external IP address of the PC but I'd really like to be able to run multiple.

I know I could use VirtualBox or similar to run new instances but I'd like all of the client applications to be running in the Visual Studio debugger.

Any help greatly appreciated!

Nick.

PS. Not sure if it matters but the applications are written in C++ using standard winsock sockets.

解决方案

You might be able to create more loopback interfaces. See the chosen answer to How do you create a virtual network interface on Windows?

这篇关于绑定到127.0.0.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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