Package org.lwjgl.util.remotery
Class RMTSettings
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.remotery.RMTSettings
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class RMTSettings extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceStructure to fill in to modify Remotery default settings.Layout
struct rmtSettings { rmtU16port(); rmtBoolreuse_open_port(); rmtBoollimit_connections_to_localhost(); rmtBoolenableThreadSampler(); rmtU32msSleepBetweenServerUpdates(); rmtU32messageQueueSizeInBytes(); rmtU32maxNbMessagesPerUpdate();rmtMallocPtr_malloc();rmtReallocPtrrealloc();rmtFreePtr_free(); void *mm_context();rmtInputHandlerPtrinput_handler(); void *input_handler_context(); rmtPStr logPath; }
-
-
Field Summary
Fields Modifier and Type Field Description static int_FREE
_MALLOCThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intENABLETHREADSAMPLER
INPUT_HANDLER
INPUT_HANDLER_CONTEXT
LIMIT_CONNECTIONS_TO_LOCALHOST
LOGPATH
MAXNBMESSAGESPERUPDATE
MESSAGEQUEUESIZEINBYTES
MM_CONTEXT
MSSLEEPBETWEENSERVERUPDATES
PORT
REALLOC
REUSE_OPEN_PORTThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description RMTSettings(java.nio.ByteBuffer container)Creates aRMTSettingsinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RMTFree_free()callback pointer for memory allocationRMTSettings_free(RMTFreeI value)Sets the specified value to the_free()field.RMTMalloc_malloc()callback pointer for memory allocationRMTSettings_malloc(RMTMallocI value)Sets the specified value to the_malloc()field.static RMTSettingscalloc()Returns a newRMTSettingsinstance allocated withmemCalloc.static RMTSettingscalloc(org.lwjgl.system.MemoryStack stack)Returns a newRMTSettingsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static RMTSettingscallocStack()Deprecated.static RMTSettingscallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static RMTSettingscreate()Returns a newRMTSettingsinstance allocated withBufferUtils.static RMTSettingscreate(long address)Returns a newRMTSettingsinstance for the specified memory address.static RMTSettingscreateSafe(long address)booleanenableThreadSampler()Whether to enable runtime thread sampling that discovers which processors a thread is running on.RMTSettingsenableThreadSampler(boolean value)Sets the specified value to theenableThreadSampler()field.RMTInputHandlerinput_handler()callback pointer for receiving input from the Remotery consoleRMTSettingsinput_handler(RMTInputHandlerI value)Sets the specified value to theinput_handler()field.longinput_handler_context()context pointer that gets sent to Remotery console callback functionRMTSettingsinput_handler_context(long value)Sets the specified value to theinput_handler_context()field.booleanlimit_connections_to_localhost()Only allow connections on localhost?RMTSettingslimit_connections_to_localhost(boolean value)Sets the specified value to thelimit_connections_to_localhost()field.java.nio.ByteBufferlogPath()RMTSettingslogPath(java.nio.ByteBuffer value)Sets the address of the specified encoded string to thelogPathfield.java.lang.StringlogPathString()static RMTSettingsmalloc()Returns a newRMTSettingsinstance allocated withmemAlloc.static RMTSettingsmalloc(org.lwjgl.system.MemoryStack stack)Returns a newRMTSettingsinstance allocated on the specifiedMemoryStack.static RMTSettingsmallocStack()Deprecated.static RMTSettingsmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.intmaxNbMessagesPerUpdate()if the user continuously pushes to the message queue, the server network code won't get a chance to update unless there's an upper-limit on how many messages can be consumed per loopRMTSettingsmaxNbMessagesPerUpdate(int value)Sets the specified value to themaxNbMessagesPerUpdate()field.intmessageQueueSizeInBytes()size of the internal message queues Remotery uses.RMTSettingsmessageQueueSizeInBytes(int value)Sets the specified value to themessageQueueSizeInBytes()field.longmm_context()memory allocation context pointerRMTSettingsmm_context(long value)Sets the specified value to themm_context()field.intmsSleepBetweenServerUpdates()how long to sleep between server updates, hopefully trying to give a little CPU back to other threadsRMTSettingsmsSleepBetweenServerUpdates(int value)Sets the specified value to themsSleepBetweenServerUpdates()field.static RMTFreen_free(long struct)Unsafe version of_free().static voidn_free(long struct, RMTFreeI value)Unsafe version of_free.static RMTMallocn_malloc(long struct)Unsafe version of_malloc().static voidn_malloc(long struct, RMTMallocI value)Unsafe version of_malloc.static intnenableThreadSampler(long struct)Unsafe version ofenableThreadSampler().static voidnenableThreadSampler(long struct, int value)Unsafe version ofenableThreadSampler.static RMTInputHandlerninput_handler(long struct)Unsafe version ofinput_handler().static voidninput_handler(long struct, RMTInputHandlerI value)Unsafe version ofinput_handler.static longninput_handler_context(long struct)Unsafe version ofinput_handler_context().static voidninput_handler_context(long struct, long value)Unsafe version ofinput_handler_context.static intnlimit_connections_to_localhost(long struct)Unsafe version oflimit_connections_to_localhost().static voidnlimit_connections_to_localhost(long struct, int value)Unsafe version oflimit_connections_to_localhost.static java.nio.ByteBuffernlogPath(long struct)Unsafe version oflogPath().static voidnlogPath(long struct, java.nio.ByteBuffer value)Unsafe version oflogPath.static java.lang.StringnlogPathString(long struct)Unsafe version oflogPathString().static intnmaxNbMessagesPerUpdate(long struct)Unsafe version ofmaxNbMessagesPerUpdate().static voidnmaxNbMessagesPerUpdate(long struct, int value)Unsafe version ofmaxNbMessagesPerUpdate.static intnmessageQueueSizeInBytes(long struct)Unsafe version ofmessageQueueSizeInBytes().static voidnmessageQueueSizeInBytes(long struct, int value)Unsafe version ofmessageQueueSizeInBytes.static longnmm_context(long struct)Unsafe version ofmm_context().static voidnmm_context(long struct, long value)Unsafe version ofmm_context.static intnmsSleepBetweenServerUpdates(long struct)Unsafe version ofmsSleepBetweenServerUpdates().static voidnmsSleepBetweenServerUpdates(long struct, int value)Unsafe version ofmsSleepBetweenServerUpdates.static shortnport(long struct)Unsafe version ofport().static voidnport(long struct, short value)Unsafe version ofport.static RMTReallocnrealloc(long struct)Unsafe version ofrealloc().static voidnrealloc(long struct, RMTReallocI value)Unsafe version ofrealloc.static intnreuse_open_port(long struct)Unsafe version ofreuse_open_port().static voidnreuse_open_port(long struct, int value)Unsafe version ofreuse_open_port.shortport()which port to listen for incoming connections onRMTSettingsport(short value)Sets the specified value to theport()field.RMTReallocrealloc()callback pointer for memory allocationRMTSettingsrealloc(RMTReallocI value)Sets the specified value to therealloc()field.booleanreuse_open_port()when this server exits it can leave the port open inTIME_WAITstate for a while.RMTSettingsreuse_open_port(boolean value)Sets the specified value to thereuse_open_port()field.RMTSettingsset(short port, boolean reuse_open_port, boolean limit_connections_to_localhost, boolean enableThreadSampler, int msSleepBetweenServerUpdates, int messageQueueSizeInBytes, int maxNbMessagesPerUpdate, RMTMallocI _malloc, RMTReallocI realloc, RMTFreeI _free, long mm_context, RMTInputHandlerI input_handler, long input_handler_context, java.nio.ByteBuffer logPath)Initializes this struct with the specified values.RMTSettingsset(RMTSettings src)Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.
-
-
-
Field Detail
-
SIZEOF
The struct size in bytes.
-
ALIGNOF
The struct alignment in bytes.
-
PORT, REUSE_OPEN_PORT, LIMIT_CONNECTIONS_TO_LOCALHOST, ENABLETHREADSAMPLER, MSSLEEPBETWEENSERVERUPDATES, MESSAGEQUEUESIZEINBYTES, MAXNBMESSAGESPERUPDATE, _MALLOC, REALLOC, _FREE, MM_CONTEXT, INPUT_HANDLER, INPUT_HANDLER_CONTEXT, LOGPATH
The struct member offsets.
-
-
Constructor Detail
-
RMTSettings
public RMTSettings(java.nio.ByteBuffer container)
Creates aRMTSettingsinstance 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
-
port
public short port()
which port to listen for incoming connections on
-
reuse_open_port
public boolean reuse_open_port()
when this server exits it can leave the port open inTIME_WAITstate for a while. This forces subsequent server bind attempts to fail when restarting. If you find restarts fail repeatedly with bind attempts, set this to true to forcibly reuse the open port.
-
limit_connections_to_localhost
public boolean limit_connections_to_localhost()
Only allow connections on localhost?For dev builds you may want to access your game from other devices but if you distribute a game to your players with Remotery active, probably best to limit connections to localhost.
-
enableThreadSampler
public boolean enableThreadSampler()
Whether to enable runtime thread sampling that discovers which processors a thread is running on.This will suspend and resume threads from outside repeatdly and inject code into each thread that automatically instruments the processor.
Default: Enabled
-
msSleepBetweenServerUpdates
public int msSleepBetweenServerUpdates()
how long to sleep between server updates, hopefully trying to give a little CPU back to other threads
-
messageQueueSizeInBytes
public int messageQueueSizeInBytes()
size of the internal message queues Remotery uses. Will be rounded to page granularity of 64k.
-
maxNbMessagesPerUpdate
public int maxNbMessagesPerUpdate()
if the user continuously pushes to the message queue, the server network code won't get a chance to update unless there's an upper-limit on how many messages can be consumed per loop
-
_malloc, realloc, _free
public RMTMalloc _malloc() public RMTRealloc realloc() public RMTFree _free()
callback pointer for memory allocation
-
mm_context
public long mm_context()
memory allocation context pointer
-
input_handler
public RMTInputHandler input_handler()
callback pointer for receiving input from the Remotery console
-
input_handler_context
public long input_handler_context()
context pointer that gets sent to Remotery console callback function
-
logPath
public java.nio.ByteBuffer logPath()
- Returns:
- a
ByteBufferview of the null-terminated string pointed to by thelogPathfield.
-
logPathString
public java.lang.String logPathString()
- Returns:
- the null-terminated string pointed to by the
logPathfield.
-
port
public RMTSettings port(short value)
Sets the specified value to theport()field.
-
reuse_open_port
public RMTSettings reuse_open_port(boolean value)
Sets the specified value to thereuse_open_port()field.
-
limit_connections_to_localhost
public RMTSettings limit_connections_to_localhost(boolean value)
Sets the specified value to thelimit_connections_to_localhost()field.
-
enableThreadSampler
public RMTSettings enableThreadSampler(boolean value)
Sets the specified value to theenableThreadSampler()field.
-
msSleepBetweenServerUpdates
public RMTSettings msSleepBetweenServerUpdates(int value)
Sets the specified value to themsSleepBetweenServerUpdates()field.
-
messageQueueSizeInBytes
public RMTSettings messageQueueSizeInBytes(int value)
Sets the specified value to themessageQueueSizeInBytes()field.
-
maxNbMessagesPerUpdate
public RMTSettings maxNbMessagesPerUpdate(int value)
Sets the specified value to themaxNbMessagesPerUpdate()field.
-
_malloc
public RMTSettings _malloc(RMTMallocI value)
Sets the specified value to the_malloc()field.
-
realloc
public RMTSettings realloc(RMTReallocI value)
Sets the specified value to therealloc()field.
-
_free
public RMTSettings _free(RMTFreeI value)
Sets the specified value to the_free()field.
-
mm_context
public RMTSettings mm_context(long value)
Sets the specified value to themm_context()field.
-
input_handler
public RMTSettings input_handler(RMTInputHandlerI value)
Sets the specified value to theinput_handler()field.
-
input_handler_context
public RMTSettings input_handler_context(long value)
Sets the specified value to theinput_handler_context()field.
-
logPath
public RMTSettings logPath(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thelogPathfield.
-
set
public RMTSettings set(short port, boolean reuse_open_port, boolean limit_connections_to_localhost, boolean enableThreadSampler, int msSleepBetweenServerUpdates, int messageQueueSizeInBytes, int maxNbMessagesPerUpdate, RMTMallocI _malloc, RMTReallocI realloc, RMTFreeI _free, long mm_context, RMTInputHandlerI input_handler, long input_handler_context, java.nio.ByteBuffer logPath)
Initializes this struct with the specified values.
-
set
public RMTSettings set(RMTSettings src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static RMTSettings malloc()
Returns a newRMTSettingsinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static RMTSettings calloc()
Returns a newRMTSettingsinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static RMTSettings create()
Returns a newRMTSettingsinstance allocated withBufferUtils.
-
create
public static RMTSettings create(long address)
Returns a newRMTSettingsinstance for the specified memory address.
-
createSafe
@Nullable public static RMTSettings createSafe(long address)
-
mallocStack
@Deprecated public static RMTSettings mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static RMTSettings callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static RMTSettings mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static RMTSettings callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
malloc
public static RMTSettings malloc(org.lwjgl.system.MemoryStack stack)
Returns a newRMTSettingsinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static RMTSettings calloc(org.lwjgl.system.MemoryStack stack)
Returns a newRMTSettingsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
nport
public static short nport(long struct)
Unsafe version ofport().
-
nreuse_open_port
public static int nreuse_open_port(long struct)
Unsafe version ofreuse_open_port().
-
nlimit_connections_to_localhost
public static int nlimit_connections_to_localhost(long struct)
Unsafe version oflimit_connections_to_localhost().
-
nenableThreadSampler
public static int nenableThreadSampler(long struct)
Unsafe version ofenableThreadSampler().
-
nmsSleepBetweenServerUpdates
public static int nmsSleepBetweenServerUpdates(long struct)
Unsafe version ofmsSleepBetweenServerUpdates().
-
nmessageQueueSizeInBytes
public static int nmessageQueueSizeInBytes(long struct)
Unsafe version ofmessageQueueSizeInBytes().
-
nmaxNbMessagesPerUpdate
public static int nmaxNbMessagesPerUpdate(long struct)
Unsafe version ofmaxNbMessagesPerUpdate().
-
nrealloc
public static RMTRealloc nrealloc(long struct)
Unsafe version ofrealloc().
-
nmm_context
public static long nmm_context(long struct)
Unsafe version ofmm_context().
-
ninput_handler
public static RMTInputHandler ninput_handler(long struct)
Unsafe version ofinput_handler().
-
ninput_handler_context
public static long ninput_handler_context(long struct)
Unsafe version ofinput_handler_context().
-
nlogPath
public static java.nio.ByteBuffer nlogPath(long struct)
Unsafe version oflogPath().
-
nlogPathString
public static java.lang.String nlogPathString(long struct)
Unsafe version oflogPathString().
-
nport
public static void nport(long struct, short value)Unsafe version ofport.
-
nreuse_open_port
public static void nreuse_open_port(long struct, int value)Unsafe version ofreuse_open_port.
-
nlimit_connections_to_localhost
public static void nlimit_connections_to_localhost(long struct, int value)Unsafe version oflimit_connections_to_localhost.
-
nenableThreadSampler
public static void nenableThreadSampler(long struct, int value)Unsafe version ofenableThreadSampler.
-
nmsSleepBetweenServerUpdates
public static void nmsSleepBetweenServerUpdates(long struct, int value)Unsafe version ofmsSleepBetweenServerUpdates.
-
nmessageQueueSizeInBytes
public static void nmessageQueueSizeInBytes(long struct, int value)Unsafe version ofmessageQueueSizeInBytes.
-
nmaxNbMessagesPerUpdate
public static void nmaxNbMessagesPerUpdate(long struct, int value)Unsafe version ofmaxNbMessagesPerUpdate.
-
n_malloc
public static void n_malloc(long struct, RMTMallocI value)Unsafe version of_malloc.
-
nrealloc
public static void nrealloc(long struct, RMTReallocI value)Unsafe version ofrealloc.
-
nmm_context
public static void nmm_context(long struct, long value)Unsafe version ofmm_context.
-
ninput_handler
public static void ninput_handler(long struct, RMTInputHandlerI value)Unsafe version ofinput_handler.
-
ninput_handler_context
public static void ninput_handler_context(long struct, long value)Unsafe version ofinput_handler_context.
-
nlogPath
public static void nlogPath(long struct, java.nio.ByteBuffer value)Unsafe version oflogPath.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-