pollForConnectionsSupport(
final AzureusCore core )
{
bContinue = true;
while (bContinue) {
BufferedReader br = null;
try {
Socket sck = socket.accept();
String address = sck.getInetAddress().getHostAddress();
if (address.equals("localhost") || address.equals("127.0.0.1")) {
br = new BufferedReader(new InputStreamReader(sck.getInputStream(),Constants.DEFAULT_ENCODING));
String line = br.readLine();
//System.out.println("received : " + line);
if (Logger.isEnabled())
Logger.log(new LogEvent(LOGID, "Main::startServer: received '"
+ line + "'"));
if (line != null) {
String [] args = parseArgs(line);
if (args != null && args.length > 0) {
String debug_str = args[0];
for (int i=1; i<args.length; i++) {
debug_str += " ; " + args[i];
}
Logger.log(new LogEvent(LOGID, "Main::startServer: decoded to '" + debug_str + "'"));
processArgs(core,args);
}
}
}
sck.close();
}
catch (Exception e) {
if(!(e instanceof SocketException))
Debug.printStackTrace( e );
//bContinue = false;
} finally {
try {
if (br != null)
br.close();
} catch (Exception e) { /*ignore */
}
}
}
}