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 ClassesModifier and TypeInterfaceDescriptionstatic class
Represents an address for a POSIX socket.Nested classes/interfaces inherited from interface com.sun.jna.Library
com.sun.jna.Library.Handler
-
Field Summary
Fields inherited from interface com.sun.jna.Library
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_SYMBOL_PROVIDER, OPTION_TYPE_MAPPER
-
Method Summary
Modifier and TypeMethodDescriptionint
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, 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, ByteBuffer buffer, int count) Writes to a POSIX socket.
-
Method Details
-
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
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
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.
-