Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize Send and Receive Socket Timeout Delays #206

Merged
merged 9 commits into from
May 16, 2020

Conversation

NPrincen
Copy link
Contributor

In the xplaneConnect.c sendUDP and readUDP functions, longer than necessary socket timeouts were being used. They were also different for Windows and Linux/Mac. These socket timeouts contribute to process time delay and potential stuttering. The timeouts are now minimized based on testing with the Example and Test programs. They are also standardized for all operating systems.

Line 209 of xplaneConnect.c has a TO DO comment for a potential future upgrade. If the xplaneConnect.c functions had message handlers like the plugin, then the socket timeout of the readUDP function could be set to 0 to make the read polling. The process would not need to wait around for a read to complete. It could move on to other tasks and read and process the UDP messages as they arrive.

In the plugin UDPSocket.cpp code, SendTo and Read were using longer than necessary socket timeouts with the same potential result as for xplaneConnect. They were also using different values between Window and Linux/Mac. The timeouts are now standardized for all operating systems and coded in the same manner as the xplaneConnect.c functions. Note that here, the Read select timeout is set to 0 in order to make the Read polling. We can do this here because of the message handling that is done in the plugin.

NPrincen added 9 commits May 9, 2020 17:12
Merge pull request nasa#205 from NPrincen/develop
sendUDP and readUDP were using longer than necessary socket timeouts that may add to process time delay and stuttering.  They were also using different values between Window and Linux/Mac.  The timeouts are now standardized for all versions.
SendTo and Read were using longer than necessary socket timeouts that may add to process time delay and stuttering.  They were also using different values between Window and Linux/Mac.  The timeouts are now standardized for all versions and coded in the same manner as the xplaneConnect.c functions.
SendTo and Read were using longer than necessary socket timeouts that may add to process time delay and stuttering.  They were also using different values between Window and Linux/Mac.  The timeouts are now standardized for all versions and coded in the same manner as the xplaneConnect.c functions.
SendTo and Read were using longer than necessary socket timeouts that may add to process time delay and stuttering.  They were also using different values between Window and Linux/Mac.  The timeouts are now standardized for all versions and coded in the same manner as the xplaneConnect.c functions.
sendUDP and readUDP were using longer than necessary socket timeouts that may add to process time delay and stuttering.  They were also using different values between Window and Linux/Mac.  The timeouts are now standardized for all versions.
SendTo and Read were using longer than necessary socket timeouts that may add to process time delay and stuttering.  They were also using different values between Window and Linux/Mac.  The timeouts are now standardized for all versions and coded in the same manner as the xplaneConnect.c functions.
@NPrincen NPrincen marked this pull request as ready for review May 13, 2020 02:11
@jason-watkins jason-watkins merged commit 0dc2bd3 into nasa:develop May 16, 2020
NPrincen added a commit to NPrincen/XPlaneConnect that referenced this pull request May 16, 2020
Merge pull request nasa#206 from NPrincen/develop
@jason-watkins jason-watkins mentioned this pull request Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants