VJ update: 忽略"127.0.0.1"

Hardcoding an IP address into source code is a bad idea for several reasons:

Noncompliant Code Example

String ip = "200.112.44.55";
Socket socket = new Socket(ip, 6667);

Compliant Solution

String ip = System.getProperty("myapplication.ip");
Socket socket = new Socket(ip, 6667);

See