Package net.bytebuddy.agent
Interface VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary
-
- All Superinterfaces:
com.sun.jna.Library
- Enclosing class:
- VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket
protected static interface VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary extends com.sun.jna.Library
A JNA library binding for Posix sockets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary.SocketAddress
Represents an address for a POSIX socket.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
close(int handle)
Closes the socket connection.int
connect(int handle, VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary.SocketAddress address, int length)
Connects a socket connection.int
kill(int processId, int signal)
Sends a kill command.int
read(int handle, java.nio.ByteBuffer buffer, int count)
Reads from a POSIX socket.int
socket(int domain, int type, int protocol)
Creates a POSIX socket connection.int
write(int handle, java.nio.ByteBuffer buffer, int count)
Writes to a POSIX socket.
-
-
-
Method Detail
-
kill
int kill(int processId, int signal) throws com.sun.jna.LastErrorException
Sends a kill command.- Parameters:
processId
- The process id to kill.signal
- The signal to send.- Returns:
- The return code.
- Throws:
com.sun.jna.LastErrorException
- If an error occurs.
-
socket
int socket(int domain, int type, int protocol) throws com.sun.jna.LastErrorException
Creates a POSIX socket connection.- Parameters:
domain
- The socket's domain.type
- The socket's type.protocol
- The protocol version.- Returns:
- A handle to the socket that was created or
0
if no socket could be created. - Throws:
com.sun.jna.LastErrorException
- If an error occurs.
-
connect
int connect(int handle, VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary.SocketAddress address, int length) throws com.sun.jna.LastErrorException
Connects a socket connection.- Parameters:
handle
- The socket's handle.address
- The address of the POSIX socket.length
- The length of the socket value.- Returns:
- The return code.
- Throws:
com.sun.jna.LastErrorException
- If an error occurs.
-
read
int read(int handle, java.nio.ByteBuffer buffer, int count) throws com.sun.jna.LastErrorException
Reads from a POSIX socket.- Parameters:
handle
- The socket's handle.buffer
- The buffer to read from.count
- The bytes being read.- Returns:
- The amount of bytes that could be read.
- Throws:
com.sun.jna.LastErrorException
- If an error occurs.
-
write
int write(int handle, java.nio.ByteBuffer buffer, int count) throws com.sun.jna.LastErrorException
Writes to a POSIX socket.- Parameters:
handle
- The socket's handle.buffer
- The buffer to write to.count
- The bytes being written.- Returns:
- The return code.
- Throws:
com.sun.jna.LastErrorException
- If an error occurs.
-
close
int close(int handle) throws com.sun.jna.LastErrorException
Closes the socket connection.- Parameters:
handle
- The handle of the connection.- Returns:
- The return code.
- Throws:
com.sun.jna.LastErrorException
- If an error occurs.
-
-