public class ClientP2P
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static boolean |
DEBUG |
private Directories |
directories |
private java.lang.String |
logDir |
private Logger |
loggerClient |
private Logger |
loggerServer |
private java.lang.String |
partsDir |
private java.util.Scanner |
scanner |
private HostItem |
server |
private HostItem |
tracker |
Constructor and Description |
---|
ClientP2P(java.lang.String hostnameServer,
int portServer,
java.lang.String hostnameTracker,
int portTracker)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
initDirectoriesAndLoggers()
Initialize loggers if directories and logger are null,
else fail silently.
|
static void |
main(java.lang.String[] args)
Main program entry point.
1rst parameter is optionnal, and is used to
define port used by the server module to listen.
|
private static void |
printUsage(ServerPortRange serverPortRange,
TrackerPortRange trackerPortRange)
Print cli usage
|
private java.lang.String logDir
private java.lang.String partsDir
private Logger loggerServer
private Logger loggerClient
private Directories directories
private HostItem tracker
private HostItem server
private java.util.Scanner scanner
static final boolean DEBUG
public ClientP2P(java.lang.String hostnameServer, int portServer, java.lang.String hostnameTracker, int portTracker)
hostnameServer
- hostname to bindportServer
- port to bindhostnameTracker
- hostname of trackerportTracker
- port of trackerpublic void initDirectoriesAndLoggers()
private static void printUsage(ServerPortRange serverPortRange, TrackerPortRange trackerPortRange)
serverPortRange
- range of server portstrackerPortRange
- range of tracker portspublic static void main(java.lang.String[] args)
args
- server listenning port