UnixDomainSocketChannel Interface

public interface UnixDomainSocketChannel

The definition for a readable and writable unix domain socket channel that may be needed in module creation depending on the Edge runtime.

Method Summary

Modifier and Type Method and Description
void close()

Close the unix domain socket.

void open(String address)

Open the unix domain socket for the provided address

int read(byte[] inputBuffer)

Read from the unix domain socket into the provided input buffer.

void write(byte[] output)

Write the provided bytes to the unix domain socket.

Method Details

close

public void close()

Close the unix domain socket.

Throws:

IOException - if the unix domain socket close fails for any reason.

open

public void open(String address)

Open the unix domain socket for the provided address

Parameters:

address - the address to open the connection to.

Throws:

IOException - if the connection fails to open for any reason.

read

public int read(byte[] inputBuffer)

Read from the unix domain socket into the provided input buffer.

Parameters:

inputBuffer - the empty byte array to be written to with the read bytes from the unix domain socket.

Returns:

the number of bytes read from the unix domain socket during this call.

Throws:

IOException - if the unix domain socket cannot be read from for any reason.

write

public void write(byte[] output)

Write the provided bytes to the unix domain socket.

Parameters:

output - the bytes to write to the unix domain socket.

Throws:

IOException - if the bytes fail to write for any reason.

Applies to