Package org.lwjgl.system.linux
Class Sockaddr
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.linux.Sockaddr
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class Sockaddr extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure describing a generic socket address.Layout
struct sockaddr { sa_family_t
sa_family()
; charsa_data()
[14]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sockaddr.Buffer
An array ofSockaddr
structs.
-
Constructor Summary
Constructors Constructor Description Sockaddr(java.nio.ByteBuffer container)
Creates aSockaddr
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Sockaddr
calloc()
Returns a newSockaddr
instance allocated withmemCalloc
.static Sockaddr.Buffer
calloc(int capacity)
Returns a newSockaddr.Buffer
instance allocated withmemCalloc
.static Sockaddr.Buffer
calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSockaddr.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static Sockaddr
calloc(org.lwjgl.system.MemoryStack stack)
Returns a newSockaddr
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static Sockaddr
create()
Returns a newSockaddr
instance allocated withBufferUtils
.static Sockaddr.Buffer
create(int capacity)
Returns a newSockaddr.Buffer
instance allocated withBufferUtils
.static Sockaddr
create(long address)
Returns a newSockaddr
instance for the specified memory address.static Sockaddr.Buffer
create(long address, int capacity)
Create aSockaddr.Buffer
instance at the specified memory.static Sockaddr
createSafe(long address)
static Sockaddr.Buffer
createSafe(long address, int capacity)
static Sockaddr
malloc()
Returns a newSockaddr
instance allocated withmemAlloc
.static Sockaddr.Buffer
malloc(int capacity)
Returns a newSockaddr.Buffer
instance allocated withmemAlloc
.static Sockaddr.Buffer
malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSockaddr.Buffer
instance allocated on the specifiedMemoryStack
.static Sockaddr
malloc(org.lwjgl.system.MemoryStack stack)
Returns a newSockaddr
instance allocated on the specifiedMemoryStack
.static java.nio.ByteBuffer
nsa_data(long struct)
Unsafe version ofsa_data()
.static byte
nsa_data(long struct, int index)
Unsafe version ofsa_data
.static void
nsa_data(long struct, int index, byte value)
Unsafe version ofsa_data
.static void
nsa_data(long struct, java.nio.ByteBuffer value)
Unsafe version ofsa_data
.static short
nsa_family(long struct)
Unsafe version ofsa_family()
.static void
nsa_family(long struct, short value)
Unsafe version ofsa_family
.java.nio.ByteBuffer
sa_data()
address databyte
sa_data(int index)
address dataSockaddr
sa_data(int index, byte value)
Sets the specified value at the specified index of thesa_data()
field.Sockaddr
sa_data(java.nio.ByteBuffer value)
Copies the specifiedByteBuffer
to thesa_data()
field.short
sa_family()
address family and lengthSockaddr
sa_family(short value)
Sets the specified value to thesa_family()
field.Sockaddr
set(short sa_family, java.nio.ByteBuffer sa_data)
Initializes this struct with the specified values.Sockaddr
set(Sockaddr src)
Copies the specified struct data to this struct.int
sizeof()
-
-
-
Constructor Detail
-
Sockaddr
public Sockaddr(java.nio.ByteBuffer container)
Creates aSockaddr
instance at the current position of the specifiedByteBuffer
container. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
sa_family
public short sa_family()
address family and length
-
sa_data
public java.nio.ByteBuffer sa_data() public byte sa_data(int index)
address data
-
sa_family
public Sockaddr sa_family(short value)
Sets the specified value to thesa_family()
field.
-
sa_data
public Sockaddr sa_data(java.nio.ByteBuffer value)
Copies the specifiedByteBuffer
to thesa_data()
field.
-
sa_data
public Sockaddr sa_data(int index, byte value)
Sets the specified value at the specified index of thesa_data()
field.
-
set
public Sockaddr set(short sa_family, java.nio.ByteBuffer sa_data)
Initializes this struct with the specified values.
-
set
public Sockaddr set(Sockaddr src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static Sockaddr malloc()
Returns a newSockaddr
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static Sockaddr calloc()
Returns a newSockaddr
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static Sockaddr create()
Returns a newSockaddr
instance allocated withBufferUtils
.
-
create
public static Sockaddr create(long address)
Returns a newSockaddr
instance for the specified memory address.
-
createSafe
@Nullable public static Sockaddr createSafe(long address)
-
malloc
public static Sockaddr.Buffer malloc(int capacity)
Returns a newSockaddr.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static Sockaddr.Buffer calloc(int capacity)
Returns a newSockaddr.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static Sockaddr.Buffer create(int capacity)
Returns a newSockaddr.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static Sockaddr.Buffer create(long address, int capacity)
Create aSockaddr.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static Sockaddr.Buffer createSafe(long address, int capacity)
-
malloc
public static Sockaddr malloc(org.lwjgl.system.MemoryStack stack)
Returns a newSockaddr
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
public static Sockaddr calloc(org.lwjgl.system.MemoryStack stack)
Returns a newSockaddr
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
public static Sockaddr.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSockaddr.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
calloc
public static Sockaddr.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSockaddr.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nsa_family
public static short nsa_family(long struct)
Unsafe version ofsa_family()
.
-
nsa_data
public static java.nio.ByteBuffer nsa_data(long struct)
Unsafe version ofsa_data()
.
-
nsa_data
public static byte nsa_data(long struct, int index)
Unsafe version ofsa_data
.
-
nsa_family
public static void nsa_family(long struct, short value)
Unsafe version ofsa_family
.
-
nsa_data
public static void nsa_data(long struct, java.nio.ByteBuffer value)
Unsafe version ofsa_data
.
-
nsa_data
public static void nsa_data(long struct, int index, byte value)
Unsafe version ofsa_data
.
-
-