Time delay Issue with async_write_some and async_read_some
Hi Team, We can see two different behaviours in communication when we tested in windows and Linux with same hardware .Windows responded slowly compared to Linux. We are using async_write_some and async_read_some methods from boost library for RS-232 communication with hardware(COM1). m_serialPort.async_write_some(boost::asio::buffer(toSend), boost::bind(&SerialPortAsync::HandleSentData, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); m_serialPort.async_read_some(boost::asio::buffer(m_RecvBuffer), boost::bind(&SerialPortAsync::HandleReceive, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); Comparison Linux Vs Windows for same application : Linux Sending Time ---> 2020/11/23 17:34:56.678585,1064, , <-- (+0.000151) (11)[010B0557,0D0001E8,03C40F] [tx-queue:24] Send Receiving Time ---> 2020/11/23 17:34:56.680490,1064, , --> (+0.001905) (8)[060B0557,040D00E8] [tx-queue:24] Turnaround time : 0.001905 Windows Sending Time ---> 2022/03/28 14:41:28.662338,5388, , <-- (+0.000000) (11)[010B0457,0D0001E8,035BDA] [tx-queue:40] Receiving Time --> 2022/03/28 14:41:28.693591,5388, , --> (+0.031253) (9)[06090457,0D0001B0,1F] [tx-queue:40] Turnaround time : 0.031253 We want to know why windows takes more time as compared to Linux. We cannot put more debug logs in the application code. Below this layer, boost library play the role to transfer the data to the Serial port Regards, Rajesh D Please be advised that this email may contain confidential information. If you are not the intended recipient, please notify us by email by replying to the sender and delete this message. The sender disclaims that the content of this email constitutes an offer to enter into, or the acceptance of, any agreement; provided that the foregoing does not invalidate the binding effect of any digital or other electronic reproduction of a manual signature that is included in any attachment.
Hi Team, We can see two different behaviours in communication when we tested in windows and Linux with same hardware .Windows responded slowly compared to Linux. We are using async_write_some and async_read_some methods from boost library for RS-232 communication with hardware(COM1). m_serialPort.async_write_some(boost::asio::buffer(toSend), boost::bind(&SerialPortAsync::HandleSentData, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); m_serialPort.async_read_some(boost::asio::buffer(m_RecvBuffer), boost::bind(&SerialPortAsync::HandleReceive, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); Conifguation is like this. Baud rate is 115200 serial_port_base::baud_rate baud_option(config.baudRate); serial_port_base::parity parity_option(ConvertParity(config.parity)); m_serialPort.set_option(baud_option); // set the baud rate after the port has been opened m_serialPort.set_option(parity_option); // These two options need to be exposed! m_serialPort.set_option(serial_port_base::character_size(8)); m_serialPort.set_option(serial_port_base::stop_bits(serial_port_base::stop_bits::one)); m_serialPort.set_option(serial_port_base::flow_control(serial_port_base::flow_control::none)); Comparison Linux Vs Windows for same application : Linux Sending Time ---> 2020/11/23 17:34:56.678585,1064, , <-- (+0.000151) (11)[010B0557,0D0001E8,03C40F] [tx-queue:24] Send Receiving Time ---> 2020/11/23 17:34:56.680490,1064, , --> (+0.001905) (8)[060B0557,040D00E8] [tx-queue:24] Turnaround time : 0.001905 Windows Sending Time ---> 2022/03/28 14:41:28.662338,5388, , <-- (+0.000000) (11)[010B0457,0D0001E8,035BDA] [tx-queue:40] Receiving Time --> 2022/03/28 14:41:28.693591,5388, , --> (+0.031253) (9)[06090457,0D0001B0,1F] [tx-queue:40] Turnaround time : 0.031253 We want to know why windows takes more time as compared to Linux. We cannot put more debug logs in the application code. Below this layer, boost library play the role to transfer the data to the Serial port Regards, Rajesh D Please be advised that this email may contain confidential information. If you are not the intended recipient, please notify us by email by replying to the sender and delete this message. The sender disclaims that the content of this email constitutes an offer to enter into, or the acceptance of, any agreement; provided that the foregoing does not invalidate the binding effect of any digital or other electronic reproduction of a manual signature that is included in any attachment.
participants (1)
-
Daggumati, Rajesh