-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Added startup, shutdown methods to IpSocket and added startup as a re… #2261
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible issues:
- Inconsistent use of
this->getSocketHandler()->[[ action ]]
andthis->[[ action]]
in SocketReadTask - No check for
isStarted
in socket read thread loop
This code works. Tested with:
Then killed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Couple of notes:
- We're going to want to remove the explicit calls to startup/shutdown in the fprime-tools cookiecutters - also in references/tutorials if we switched any to be TcpServers already?
- Browsing through the code while reviewing this, I noticed that all references to Berkeley sockets in the codebase are misspelled (missing an "e" in Berkeley, e.g. here). This PR could be a good opportunity to fix that with a quick search/replace?
REMINDERPlease merge nasa/fprime-tools#168 after this has been merged |
206ebc2
to
9d1accd
Compare
…try step
Change Description
Briefly, fixes the
TcpServer
such that it will retry both thelisten
andaccept
steps not just the accept step.More in-depth:
Sockets originally were implemented with
open
andclose
steps. However, some sockets (like the TcpServer) needed to havestartup
andshowdown
steps too. This was patched in directly to this socket, which meant that retries on generic sockets didn't handle this case.This PR adds:
startup
andshutdown
methods generically to all sockets (with the default being no-op)isStarted
method to check status