public Server()
{
hasConnectedIncomming = ConnectionPrefs.HasConnectedIncomming.get().boolea nValue();
lastInConnectionTime = -1;
isRunning = false;
/** localAddress = new LocalServentAddress( this );
if ( ProxyPrefs.ForcedIp.get().length() > 0)
{
IpAddress ip = new IpAddress(
AddressUtils.parseIP( ProxyPrefs.ForcedIp.get() ) );
localAddress.setForcedHostIP( ip );
}
*/
} public Server()
{
hasConnectedIncomming = ConnectionPrefs.HasConnectedIncomming.get().boolea nValue();
lastInConnectionTime = -1;
isRunning = false;
/** localAddress = new LocalServentAddress( this );
if ( ProxyPrefs.ForcedIp.get().length() > 0)
{
IpAddress ip = new IpAddress(
AddressUtils.parseIP( ProxyPrefs.ForcedIp.get() ) );
localAddress.setForcedHostIP( ip );
}
*/
}
private void setupLocalAddress()
{
localAddress =new LocalServentAddress(this);
if ( ProxyPrefs.ForcedIp.get().length() > 0)
{
IpAddress ip = new IpAddress(
AddressUtils.parseIP( ProxyPrefs.ForcedIp.get() ) );
localAddress.setForcedHostIP( ip );
}
}
public synchronized void startup() throws IOException
{
setupLocalAddress();
if (isRunning)
{
return;
}
NLogger.debug( Server.class, "Starting listener");
isRunning = true;
firewallCheckTimer = new FirewallCheckTimer();
Environment.getInstance().scheduleTimerTask( firewallCheckTimer,
FirewallCheckTimer.TIMER_PERIOD,
FirewallCheckTimer.TIMER_PERIOD );
bind( NetworkPrefs.ListeningPort.get().intValue() );
// localAddress = new LocalServentAddress( this );
ThreadPool.getInstance().addJob(this,
"IncommingListener-" + Integer.toHexString(hashCode()));
}
private void setupLocalAddress()
{
localAddress =new LocalServentAddress(this);
if ( ProxyPrefs.ForcedIp.get().length() > 0)
{
IpAddress ip = new IpAddress(
AddressUtils.parseIP( ProxyPrefs.ForcedIp.get() ) );
localAddress.setForcedHostIP( ip );
}
}
public synchronized void startup() throws IOException
{
setupLocalAddress();
if (isRunning)
{
return;
}
NLogger.debug( Server.class, "Starting listener");
isRunning = true;
firewallCheckTimer = new FirewallCheckTimer(); public Server()
{
hasConnectedIncomming = ConnectionPrefs.HasConnectedIncomming.get().boolea nValue();
lastInConnectionTime = -1;
isRunning = false;
/** localAddress = new LocalServentAddress( this );
if ( ProxyPrefs.ForcedIp.get().length() > 0)
{
IpAddress ip = new IpAddress(
AddressUtils.parseIP( ProxyPrefs.ForcedIp.get() ) );
localAddress.setForcedHostIP( ip );
}
*/
}
private void setupLocalAddress()
{
localAddress =new LocalServentAddress(this);
if ( ProxyPrefs.ForcedIp.get().length() > 0)
{
IpAddress ip = new IpAddress(
AddressUtils.parseIP( ProxyPrefs.ForcedIp.get() ) );
localAddress.setForcedHostIP( ip );
}
}
public synchronized void startup() throws IOException
{
setupLocalAddress();
if (isRunning)
{
return;
}
NLogger.debug( Server.class, "Starting listener");
isRunning = true;
firewallCheckTimer = new FirewallCheckTimer();
Environment.getInstance().scheduleTimerTask( firewallCheckTimer,
FirewallCheckTimer.TIMER_PERIOD,
FirewallCheckTimer.TIMER_PERIOD );
bind( NetworkPrefs.ListeningPort.get().intValue() );
// localAddress = new LocalServentAddress( this );
ThreadPool.getInstance().addJob(this,
"IncommingListener-" + Integer.toHexString(hashCode()));
}
Environment.getInstance().scheduleTimerTask( firewallCheckTimer,
FirewallCheckTimer.TIMER_PERIOD,
FirewallCheckTimer.TIMER_PERIOD );
bind( NetworkPrefs.ListeningPort.get().intValue() );
// localAddress = new LocalServentAddress( this );
ThreadPool.getInstance().addJob(this,
"IncommingListener-" + Integer.toHexString(hashCode()));
}
I was just moving the setupLocalAddress method into startup.
Actually, your phex is very good and helpful to me. I was a c++ programmer before and new of java programming. So I should say "thank you" to you. |