Package ej.wasi.io.socket
Interface WasiSocketOpt
-
- All Known Implementing Classes:
WasiDatagramSocket,WasiServerSocket,WasiSocket
public interface WasiSocketOptWasi socket options
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleangetBroadcast()Get the SO_BROADCAST socket option.intgetReceiveBufferSize()Get the receive buffer size (SO_RCVBUF).intgetSendBufferSize()Get the send buffer size (SO_SNDBUF).voidsetBroadcast(boolean on)Enable/disable the SO_BROADCAST socket option.voidsetNonBlocking(boolean on)Enable/disable the non blocking state on this WasiIOvoidsetReceiveBufferSize(int size)Set the receive buffer size (SO_RCVBUF).voidsetReuseAddress(boolean on)Enable/disable the reuse address socket option.voidsetSendBufferSize(int size)Set the send buffer size (SO_SNDBUF).
-
-
-
Method Detail
-
setNonBlocking
void setNonBlocking(boolean on) throws IOExceptionEnable/disable the non blocking state on this WasiIO- Parameters:
on- whether to enable or disable the non-blocking socket option- Throws:
IOException- if an I/O error occurs.
-
setReuseAddress
void setReuseAddress(boolean on) throws IOExceptionEnable/disable the reuse address socket option.- Parameters:
on- whether to enable or disable the reuse address socket option- Throws:
IOException- if an I/O error occurs.
-
setBroadcast
void setBroadcast(boolean on) throws IOExceptionEnable/disable the SO_BROADCAST socket option. Only meaningful for datagram sockets; stream sockets should ignore this call.- Parameters:
on- whether to enable or disable broadcast- Throws:
IOException- if an I/O error occurs.
-
getBroadcast
boolean getBroadcast() throws IOExceptionGet the SO_BROADCAST socket option. Only meaningful for datagram sockets; stream and server sockets always returnfalse.- Returns:
- whether broadcast is enabled
- Throws:
IOException- if an I/O error occurs.
-
setReceiveBufferSize
void setReceiveBufferSize(int size) throws IOExceptionSet the receive buffer size (SO_RCVBUF).- Parameters:
size- the buffer size in bytes- Throws:
IOException- if an I/O error occurs.
-
getReceiveBufferSize
int getReceiveBufferSize() throws IOExceptionGet the receive buffer size (SO_RCVBUF).- Returns:
- the buffer size in bytes
- Throws:
IOException- if an I/O error occurs.
-
setSendBufferSize
void setSendBufferSize(int size) throws IOExceptionSet the send buffer size (SO_SNDBUF).- Parameters:
size- the buffer size in bytes- Throws:
IOException- if an I/O error occurs.
-
getSendBufferSize
int getSendBufferSize() throws IOExceptionGet the send buffer size (SO_SNDBUF).- Returns:
- the buffer size in bytes
- Throws:
IOException- if an I/O error occurs.
-
-