public class ScmpSender extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
ScmpSender.Builder |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
InetSocketAddress |
getLocalAddress() |
int |
getTimeOut() |
static ScmpSender.Builder |
newBuilder() |
Scmp.EchoMessage |
sendEchoRequest(Path path,
ByteBuffer data)
Sends a SCMP echo request to the connected destination.
|
List<Scmp.TracerouteMessage> |
sendTracerouteRequest(Path path)
Sends a SCMP traceroute request to the connected destination.
|
<T> void |
setOption(SocketOption<T> option,
T t)
This is currently only useful for
ScionSocketOptions.SCION_API_THROW_PARSER_FAILURE. |
void |
setOverrideSourceAddress(InetSocketAddress overrideSourceAddress)
Specify a source address override.
|
Consumer<Scmp.ErrorMessage> |
setScmpErrorListener(Consumer<Scmp.ErrorMessage> listener) |
void |
setTimeOut(int milliSeconds) |
public static ScmpSender.Builder newBuilder()
public Scmp.EchoMessage sendEchoRequest(Path path, ByteBuffer data) throws IOException
path - The path to use.data - user data that is sent with the requestIOException - if an IO error occurs or if an SCMP error is received.public List<Scmp.TracerouteMessage> sendTracerouteRequest(Path path) throws IOException
path - The path to use.IOException - if an IO error occurs or if an SCMP error is received.public void setTimeOut(int milliSeconds)
public int getTimeOut()
public void close()
throws IOException
close in interface AutoCloseableIOExceptionpublic Consumer<Scmp.ErrorMessage> setScmpErrorListener(Consumer<Scmp.ErrorMessage> listener)
public <T> void setOption(SocketOption<T> option, T t) throws IOException
ScionSocketOptions.SCION_API_THROW_PARSER_FAILURE.T - option typeoption - optiont - valueIOException - in case of IO errorpublic InetSocketAddress getLocalAddress() throws IOException
IOExceptionpublic void setOverrideSourceAddress(InetSocketAddress overrideSourceAddress)
AbstractDatagramChannel.setOverrideSourceAddress(InetSocketAddress).overrideSourceAddress - Override addressCopyright © 2024. All rights reserved.