Package | Description |
---|---|
clientP2P | |
protocolP2P | |
tools |
Modifier and Type | Method and Description |
---|---|
void |
ClientManagement.download(java.lang.String filename)
Try to download a file
|
java.lang.String[] |
ClientManagement.listDirectory()
list server’s directory content
|
Modifier and Type | Method and Description |
---|---|
private int |
ProtocolP2PPacketUDP.computeCheckSum(byte[] packet)
Compute checksum associated to packet.
|
private void |
ProtocolP2PPacketUDP.constructPacket(byte[] packet)
Private constructor helper with packet as byte[] parameter (typically used when receiving Packet response/request).
|
private void |
ProtocolP2PPacketTCP.constructPacket(byte[] packet)
Private constructor helper with packet as byte[] parameter (typically used when receiving Packet response/request).
|
private void |
ProtocolP2PPacketUDP.constructPacket(byte[] packet,
java.net.DatagramSocket responseSocket)
Private constructor helper with packet as byte[] parameter and (typically used when receiving Packet request).
|
private void |
ProtocolP2PPacketTCP.constructPacket(byte[] packet,
java.net.Socket responseSocket)
Private constructor helper with packet as byte[] parameter and (typically used when receiving Packet request).
|
private int |
FilePart.getFilenameSize(byte[] packet)
Read filename’s size from Packet.
|
protected static int |
Payload.getPayloadSize(byte[] packet)
Get payload’s size from a Packet.
|
ProtocolP2PPacket<?> |
ProtocolP2PPacketUDP.receiveResponse()
Receive response (typically used by client).
|
ProtocolP2PPacket<?> |
ProtocolP2PPacketTCP.receiveResponse()
Receive response (typically used by client).
|
abstract ProtocolP2PPacket<?> |
ProtocolP2PPacket.receiveResponse()
Receive a response
|
private void |
FilePart.setFilename(byte[] packet)
Write from Packet into filename.
|
private void |
FilePart.setOffset(byte[] packet)
Write from Packet into offset.
|
private void |
FilePart.setPartialContent(byte[] packet)
Write from Packet into partialContent.
|
Constructor and Description |
---|
Denied(byte[] packet)
Constructor (typically used by client) with Packet received as parameter.
|
DiscoverRequest(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
DiscoverResponse(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
FileList(byte[] packet)
Constructor (typically used by client) with a byte[] parameter containing the Packet received.
|
FilePart(byte[] packet)
Constructor (typically used by client) with Packet received as parameter.
|
HashRequest(byte[] packet)
Constructor (typically used by client) with a byte[] parameter containing the Packet received.
|
HashResponse(byte[] packet)
Constructor (typically used by client) with a byte[] parameter containing the Packet received.
|
LoadRequest(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
Payload(byte[] packet)
Constructor used to create a Payload (when no more specific subclasses exists) using packet as parameter.
|
ProtocolP2PPacket(byte[] packet)
Construct a packet from byte[], subclasses must overwrite this constructor.
|
ProtocolP2PPacket(java.lang.Object socket)
Receive a request, subclasses must overwrite this constructor.
|
ProtocolP2PPacketTCP(byte[] packet)
Private constructor with packet as byte[] parameter (typically used when receiving Packet response).
|
ProtocolP2PPacketTCP(java.lang.Object socket)
Receive Request (typically used from server).
|
ProtocolP2PPacketUDP(byte[] packet)
Private constructor with packet as byte[] parameter (typically used when receiving Packet response).
|
ProtocolP2PPacketUDP(java.lang.Object socket)
Receive Request (typically used from server).
|
RatioRequest(byte[] packet)
Constructor (typically used by tracker) with a byte[] parameter containing the Packet received.
|
RatioResponse(byte[] packet)
Constructor (typically used by client/server) with a byte[] parameter containing the Packet received.
|
Register(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
SizeRequest(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
SizeResponse(byte[] packet)
Constructor (typically used by client) with Packet received as parameter.
|
Unregister(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
UpdateRatio(byte[] packet)
Constructor (typically used by tracker) with a byte[] parameter containing the Packet received.
|
Modifier and Type | Method and Description |
---|---|
static int |
BytesArrayTools.readInt(byte[] array,
int start)
Read int from a bytearray
|
static long |
BytesArrayTools.readLong(byte[] array,
int start)
Read long from a bytearray
|
static void |
BytesArrayTools.write16Bits(byte[] array,
int start,
int value)
Write int in a bytearray 16 bits version
|