Streaming: Add API for sending/receiving payload in ping/pong

This commit is contained in:
zzz
2015-01-05 15:09:12 +00:00
parent 045f6dccf8
commit 6e847a4cc4
4 changed files with 143 additions and 9 deletions

View File

@@ -158,7 +158,31 @@ public interface I2PSocketManager {
*/
public boolean ping(Destination peer, int localPort, int remotePort, long timeoutMs);
/**
* Ping the specified peer, returning true if they replied to the ping within
* the timeout specified, false otherwise. This call blocks.
*
* Uses the ports specified.
*
* @param peer Destination to ping
* @param localPort 0 - 65535
* @param remotePort 0 - 65535
* @param timeoutMs timeout in ms, greater than zero
* @param payload to include in the ping
* @return the payload received in the pong, zero-length if none, null on failure or timeout
* @throws IllegalArgumentException
* @since 0.9.18
*/
public byte[] ping(Destination peer, int localPort, int remotePort, long timeoutMs, byte[] payload);
/**
* For logging / diagnostics only
*/
public String getName();
/**
* For logging / diagnostics only
*/
public void setName(String name);
/**