public class ClientDownloadPartTCP extends ClientDownloadPart
| Modifier and Type | Field and Description |
|---|---|
private java.net.Socket |
socket |
client, failed, filename, logger, manager, MAX_PARTIAL_SIZE, noTask, partsSubdir, pendingTasks, receivedBytesCount, stop, tasksDone, tasksListsLock, toDoTasks| Constructor and Description |
|---|
ClientDownloadPartTCP(ClientDownload manager,
java.lang.String filename,
java.net.Socket socket,
java.lang.String partsSubdir,
Logger logger,
HostItem client,
HostItem server)
Constructor with filename, socket, and part subdir
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeSocket()
Close the socket
|
protected <T extends Payload> |
createProtocolP2PPacket(T payload)
Create packets
|
protected java.lang.Object |
getSocket()
Get the socket
|
protected void |
writeLog(java.lang.Exception e,
LogLevel logLevel)
Implementation of writeLog
|
protected void |
writeLog(java.lang.String text,
LogLevel logLevel)
Implementation of writeLog
|
assignTask, doTasks, downloadPart, getDone, getFailed, getReceivedBytesCount, getServer, hasFailed, reqPart, run, setStopsendEmptyDirectory, sendEmptyFile, sendInternalError, sendNotATracker, sendNotFound, sendUnknownHostpublic ClientDownloadPartTCP(ClientDownload manager, java.lang.String filename, java.net.Socket socket, java.lang.String partsSubdir, Logger logger, HostItem client, HostItem server)
filename - name of file to downloadsocket - socket to usepartsSubdir - directory to store .part fileslogger - Loggerclient - HostItem of the applicationserver - HostItem of the server applicationprotected java.lang.Object getSocket()
getSocket in class ClientDownloadPartprotected void closeSocket()
throws java.io.IOException
closeSocket in class ClientDownloadPartjava.io.IOExceptionprotected void writeLog(java.lang.String text,
LogLevel logLevel)
writeLog in class ServeErrorstext - Text to loglogLevel - level of loggingprotected void writeLog(java.lang.Exception e,
LogLevel logLevel)
writeLog in class ServeErrorse - exception to loglogLevel - level of loggingprotected <T extends Payload> ProtocolP2PPacket<T> createProtocolP2PPacket(T payload)
createProtocolP2PPacket in class ServeErrorspayload - Payload