vsTASKER 7 User Manual
×
Menu
Index

Lan Setup

 
Lan Setup
1

Emitters

1. Emitters
List of all the SockItems in emitting mode.
 
2

Edit

2. Edit
Call the selected SockItem property window.
 
3

Delete

3. Delete
Remove the selected SockItem of the list.
 
4

Delete All

4. Delete All
Remove all SockItems of the above list.
 
5

Import / Export

5. Import / Export
Import will save all the current SockItems and the LAN setting (including declarations) to /Data/Shared directory. Extension is lan.
That can be useful for reusing a specific communication package or saving the current one to be replaced by another stored one.
Use Export to store the actual LAN setting (including declarations and all SockItems) into a package file for later import into another database.
Importing a new package will erase all SockItems and replace the current LAN settings.
6

Revert All

6. Revert All
 
7

Pragma Pack(1)

7. Pragma Pack(1)
If checked, will add the #pragma pack(1) macro into the header file to force data structure packing to 1 byte so that the size of the exchanged structures with other computer will remain the same.
This packing will be done on user data classes inheriting from MsgData (see Engine/vt_sockets.h). MsgData is already packed and sized 8 bytes. The first 2 bytes are for the source, the following 2 bytes are for the type and the last 4 bytes are for the (total) length of the message.
So, if a MyMsg class inheriting from MsgData contains a short value, the size of MyMsg will be the following:
  • Without pragma pack(1): 8 + 4 = 12 bytes
  • With pragma pack(1): 8 + 2 = 10 bytes
8

Disabled

8. Disabled
If checked, the LAN capability will be deactivated. No communication will be established. Faster than disabling all SockItems.
Useful to mute the simulation engine from the distribution network (if running without socket communication is allowed).
 
9

Receivers

9. Receivers
List of all the SockItems in receiving mode.
 
10

Connect Sockets

10. Connect Sockets
Specify when the sockets must be created and connected to their port.
  • After Start: when the simulation is run
  • Before Start: after the simulation is loaded but before it is started.
 
11

Source ID

11. Source ID
  • If Source ID is 0, this option is ignored: outgoing messages will not be stamped. If not zero, all outgoing messages will be stamped with the value (first byte of the header).
  • If Filter Out is checked, all incoming messages with same Source ID will be ignored but removed from the socket buffer !
    .
This is useful when a socket writes to the same port as a listener, to avoid picking the sent data.
In order to process only messages from a specific source, add in the Socket Receive top part the following code: if (msg->source == whatever) ...
 
Deprecated old logic (copied here to help migrating your code) :
  • If Filter Out is checked, only the incoming messages whose Source ID differs from the current Source ID value will be kept and processed. All with same ID will be discarded.
• If Filter Out is not checked, only the messages with the same Source ID will be kept and processed.
12

Declaration

12.
Add here all your message data classes using the following format:
class my_data : public MsgData 
{
        public: my_data() { size = sizeof(*this); type = 123; }
};
where 123 is the class type integer of your choice.
add after your own data.