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.LibraryA JNA library binding for POSIX sockets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classVirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary.SocketAddressRepresents an address for a POSIX socket.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intclose(int handle)Closes the socket connection.intconnect(int handle, VirtualMachine.ForHotSpot.Connection.ForJnaPosixSocket.PosixLibrary.SocketAddress address, int length)Connects a socket connection.intkill(int processId, int signal)Sends a kill command.intread(int handle, java.nio.ByteBuffer buffer, int count)Reads from a POSIX socket.intsocket(int domain, int type, int protocol)Creates a POSIX socket connection.intwrite(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.LastErrorExceptionSends 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.LastErrorExceptionCreates 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
0if 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.LastErrorExceptionConnects 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.LastErrorExceptionReads 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.LastErrorExceptionWrites 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.
-
-