Changeset 1253
- Timestamp:
- Oct 22, 2010, 10:47:40 AM (13 years ago)
- Location:
- extensions/net.sf.basedb.torrent/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.torrent/trunk/src/main/net/sf/basedb/clients/torrent/service/TorrentService.java
r1251 r1253 28 28 29 29 import java.io.IOException; 30 import java.net.InetAddress; 31 import java.net.InetSocketAddress; 30 32 import java.util.Properties; 31 33 … … 85 87 86 88 private final java.io.File workDir; 89 private final String address; 87 90 private final int port; 88 91 private volatile boolean isRunning; 89 92 private Client btClient; 93 private InetSocketAddress listenAddress; 90 94 91 95 /** … … 100 104 } 101 105 this.workDir = new java.io.File(dir); 106 this.address = Values.getStringOrNull(properties.getProperty("torrents.listen-address")); 102 107 this.port = Values.getInt(properties.getProperty("torrents.listen-port")); 103 108 } … … 119 124 log.info("Starting Bittorrent Download Service"); 120 125 log.debug("Working directory: " + workDir); 126 log.debug("Listen address: " + address); 121 127 log.debug("Listen port: " + port); 122 128 … … 137 143 { 138 144 tmpClient = new Client(); 139 tmpClient.startProtocol(port); 145 InetAddress tmpAddress = null; 146 if (address != null) tmpAddress = InetAddress.getByName(address); 147 InetSocketAddress socketAddress = new InetSocketAddress(tmpAddress, port); 148 listenAddress = tmpClient.startProtocol(socketAddress); 149 log.debug("Connected to: " + listenAddress); 140 150 } 141 151 catch (IOException ex) -
extensions/net.sf.basedb.torrent/trunk/torrent.properties
r1246 r1253 7 7 torrents.work-dir = 8 8 9 # The local address the torrent service will listen on for incoming connections. 10 # If not specified it will listen to the wildcard address (0.0.0.0) 11 torrents.listen-address = 12 9 13 # The port the torrent service will listen on for incoming connections. 10 torrents.listen-port = 17777 14 # If 0 or not specified the system will select a random free port 15 torrents.listen-port = 11 16
Note: See TracChangeset
for help on using the changeset viewer.