IG::DIS::Connector Class
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to- Sim
SDK edition to use it.
You should upgrade to
Header: | #include <UnigineDISConnector.h> |
IG::DIS::Connector Class
Members
void init ( String ip, int site, int exercise, int app, int port ) #
Initializes the DIS Connector using the given parameters.Arguments
- String ip - Broadcast address of the server computer that is used to broadcast messages to IG over the network
- int site - Site ID of this application instance.
- int exercise - Exercise ID of the DIS.
- int app - Application ID of this application instance. If not set, will be generated automatically.
- int port - Connection port. This argument is optional, default value is 3000.
void setConnectCallback ( Unigine::CallbackBase * func ) #
Sets the parameter to be called when connection is established.Arguments
- Unigine::CallbackBase * func - Parameter to be called when connection is established.
Unigine::CallbackBase * getConnectCallback ( ) #
Returns the parameter that is called when connection is established.Return value
Parameter to be called when connection is established.void setCallbackOnRecvPacket ( int pdu_type, Unigine::CallbackBase * func ) #
Sets the parameter to be called when the packet is received.Arguments
- int pdu_type - PDU type.
- Unigine::CallbackBase * func - Parameter to be called when the packet is received. Callback's signature: void func(KDIS::PDU::Header *packet).
Unigine::CallbackBase * getReceivePacketCallback ( int pdu_type ) #
Returns the parameter that is called when the packet is received.Arguments
- int pdu_type - PDU type.
Return value
Parameter to be called when the packet is received.int64_t getInternalEntityID ( int app, int id ) #
Returns the IG internal entity ID.Arguments
- int app - Application ID.
- int id - DIS entity ID.
Return value
IG internal entity ID.void setManualPacketProcess ( bool enabled ) #
Enables or disables manual processing of packets. By default, certain packets are processed automatically. If manual processing is enabled, packets are just passed to a callback.Arguments
- bool enabled - Flag: true if the manual packet process is enabled; otherwise, false. The default value is false.
void setConnectionThreadCallbacks ( Unigine::CallbackBase * on_connect, Unigine::CallbackBase * on_disconnect ) #
Sets callbacks for tuning the connection instance.This callback will be invoked in a thread that is not the main thread.
Arguments
- Unigine::CallbackBase * on_connect - Parameter to be called in the connection thread immediately after the connection is established. Callback's signature: void func(KDIS::NETWORK::Connection * connection).
-
Unigine::CallbackBase * on_disconnect - Parameter to be called after a connection failure or shutdown. Callback's signature: void func(KDIS::NETWORK::Connection * connection).
Connection may be nullptr.
Last update:
24.11.2020
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter