Gnutella Forums  

Go Back   Gnutella Forums > Current Gnutella Client Forums > Phex (Cross-platform) > Development & Coding > Adapting Phex (private networks)
Register FAQ The Twelve Commandments Members List Calendar Arcade Find the Best VPN Today's Posts

Adapting Phex (private networks) Private networks, modified versions and similar


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #15 (permalink)  
Old June 2nd, 2008
Devotee
 
Join Date: May 8th, 2008
Posts: 23
uchelong is flying high
Default

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.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 08:47 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.

Copyright © 2020 Gnutella Forums.
All Rights Reserved.