android开发调用本地的webService 时 报错:
failed to connect to localhost/127.0.0.1 (port 80) after 20000ms: isConnected failed: ECONNREFUSED (Connection refused)
原来android程序将127.0.0.1或localhost地址默认为模拟器的IP,而不是电脑的IP,所以无法找到连接进行通信。
而android将本机电脑的IP 默认为10.0.2.2 只要将socket 连接到此地址即可。