This section describes the traces that are closely related to PiaTransport. For basic information about traces, see 2.2. Log Output in the 2. PiaCommon Guide.
The packets in Pia are the units for sending and receiving data in Pia communications. The outputs for traces associated with packet sends and receives are listed below.
nn::pia::common::Trace::GetInstance()->SetFlag(
nn::pia::common::TRACE_FLAG_TRANSPORT_PACKET_SEND | nn::pia::common::TRACE_FLAG_TRANSPORT_PACKET_RECEIVE ); |
You can keep information about sent and received packets in a log by enabling these trace flags and running the program. The trace output for packets is shown below.
// Example of a send log:
[Pia] SendPacket Dest: 1/00000002/ 192.168.87.2:52447/ 0 Size: 84 SID:001c CID:c4 TTL: 0 ProtocolId:20000000 // Example of a receive log: [Pia] ReceivePacket Src: 192.168.87.2:52447/ 0 Size: 84 SID:0044 CID:4c ProtocolId:20000000 |
Protocol messages in Pia are the units for communication data in the Pia protocol. Protocol messages that have the same destination station are gathered into one packet and sent (packet bundling). Received packets are split into protocol messages. Outputs for traces associated with protocol message sends and receives are listed below.
nn::pia::common::Trace::GetInstance()->SetFlag(
nn::pia::common::TRACE_FLAG_TRANSPORT_PROTOCOLMESSAGE_SEND | nn::pia::common::TRACE_FLAG_TRANSPORT_PROTOCOLMESSAGE_RECEIVE ); |
You can keep information about sent and received protocol messages in a log by enabling these trace flags and running the program. The trace output for protocol messages is below.
// Example of a send log:
[Pia] CP Dest: 1/00000002/ 192.168.87.2:52447/ 0 Size: 68 SID:001c CID:c4 [Pia] 0- 56( 33) 20000000 0(00349047)->00000002(B) --- 00000000 // Example of a receive log: [Pia] PP Src: 192.168.87.2:52447/ 0 Size: 68 SID:0045 CID:4c o [Pia] 0- 56( 33) 20000000 1(0034904d)->00000001(B) --- 00000000 |
The trace feature is extremely effective for uses such as bug tracking. However, if a large number of traces are output, the CPU processing load increases (depending on processing limitations) and the rate of packet loss deteriorates. These conditions can be greatly improved by using the caching feature in the console output available in Pia. For more information, see the description of the cached print feature in 2.2. Log Output.