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.NativeResourceStructure describing a generic socket address.Layout
struct sockaddr { sa_family_tsa_family(); charsa_data()[14]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSockaddr.BufferAn array ofSockaddrstructs.
-
Constructor Summary
Constructors Constructor Description Sockaddr(java.nio.ByteBuffer container)Creates aSockaddrinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Sockaddrcalloc()Returns a newSockaddrinstance allocated withmemCalloc.static Sockaddr.Buffercalloc(int capacity)Returns a newSockaddr.Bufferinstance allocated withmemCalloc.static Sockaddr.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSockaddr.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static Sockaddrcalloc(org.lwjgl.system.MemoryStack stack)Returns a newSockaddrinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static Sockaddrcreate()Returns a newSockaddrinstance allocated withBufferUtils.static Sockaddr.Buffercreate(int capacity)Returns a newSockaddr.Bufferinstance allocated withBufferUtils.static Sockaddrcreate(long address)Returns a newSockaddrinstance for the specified memory address.static Sockaddr.Buffercreate(long address, int capacity)Create aSockaddr.Bufferinstance at the specified memory.static SockaddrcreateSafe(long address)static Sockaddr.BuffercreateSafe(long address, int capacity)static Sockaddrmalloc()Returns a newSockaddrinstance allocated withmemAlloc.static Sockaddr.Buffermalloc(int capacity)Returns a newSockaddr.Bufferinstance allocated withmemAlloc.static Sockaddr.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSockaddr.Bufferinstance allocated on the specifiedMemoryStack.static Sockaddrmalloc(org.lwjgl.system.MemoryStack stack)Returns a newSockaddrinstance allocated on the specifiedMemoryStack.static java.nio.ByteBuffernsa_data(long struct)Unsafe version ofsa_data().static bytensa_data(long struct, int index)Unsafe version ofsa_data.static voidnsa_data(long struct, int index, byte value)Unsafe version ofsa_data.static voidnsa_data(long struct, java.nio.ByteBuffer value)Unsafe version ofsa_data.static shortnsa_family(long struct)Unsafe version ofsa_family().static voidnsa_family(long struct, short value)Unsafe version ofsa_family.java.nio.ByteBuffersa_data()address databytesa_data(int index)address dataSockaddrsa_data(int index, byte value)Sets the specified value at the specified index of thesa_data()field.Sockaddrsa_data(java.nio.ByteBuffer value)Copies the specifiedByteBufferto thesa_data()field.shortsa_family()address family and lengthSockaddrsa_family(short value)Sets the specified value to thesa_family()field.Sockaddrset(short sa_family, java.nio.ByteBuffer sa_data)Initializes this struct with the specified values.Sockaddrset(Sockaddr src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
Sockaddr
public Sockaddr(java.nio.ByteBuffer container)
Creates aSockaddrinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin 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 specifiedByteBufferto 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 newSockaddrinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static Sockaddr calloc()
Returns a newSockaddrinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static Sockaddr create()
Returns a newSockaddrinstance allocated withBufferUtils.
-
create
public static Sockaddr create(long address)
Returns a newSockaddrinstance for the specified memory address.
-
createSafe
@Nullable public static Sockaddr createSafe(long address)
-
malloc
public static Sockaddr.Buffer malloc(int capacity)
Returns a newSockaddr.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static Sockaddr.Buffer calloc(int capacity)
Returns a newSockaddr.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static Sockaddr.Buffer create(int capacity)
Returns a newSockaddr.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static Sockaddr.Buffer create(long address, int capacity)
Create aSockaddr.Bufferinstance 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 newSockaddrinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static Sockaddr calloc(org.lwjgl.system.MemoryStack stack)
Returns a newSockaddrinstance allocated on the specifiedMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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.
-
-