Skip to content

Commit

Permalink
Review fixes I
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Aug 28, 2023
1 parent c37717d commit 206ebc2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Drv/Ip/SocketReadTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Os::Task::TaskStatus SocketReadTask::joinSocketTask(void** value_ptr) {

void SocketReadTask::stopSocketTask() {
this->m_stop = true;
this->shutdown(); // Break out of any receives and fully shutdown
this->getSocketHandler().shutdown(); // Break out of any receives and fully shutdown
}

void SocketReadTask::readTask(void* pointer) {
Expand All @@ -88,7 +88,7 @@ void SocketReadTask::readTask(void* pointer) {
}

// If the network connection is open, read from it
if (self->getSocketHandler().isOpened() and (not self->m_stop)) {
if (self->getSocketHandler().isStarted() and self->getSocketHandler().isOpened() and (not self->m_stop)) {
Fw::Buffer buffer = self->getBuffer();
U8* data = buffer.getData();
FW_ASSERT(data);
Expand Down
2 changes: 1 addition & 1 deletion Drv/Ip/SocketReadTask.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class SocketReadTask {
/**
* \brief startup the socket for communications
*
* Startus up the socket handler.
* Status of the socket handler.
*
* Note: this just delegates to the handler
*
Expand Down
1 change: 1 addition & 0 deletions Drv/Ip/TcpServerSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void TcpServerSocket::shutdown() {
SocketIpStatus TcpServerSocket::openProtocol(NATIVE_INT_TYPE& fd) {
NATIVE_INT_TYPE clientFd = -1;
NATIVE_INT_TYPE serverFd = -1;

// Check started before allowing open
if (not this->isStarted()) {
return SOCK_NOT_STARTED;
Expand Down
1 change: 1 addition & 0 deletions Ref/Top/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set(MOD_DEPS
# Communication Implementations
Drv/Udp
Drv/TcpClient
Drv/TcpServer
)

register_fprime_module()

0 comments on commit 206ebc2

Please sign in to comment.