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

#2074 Parameterize buffer size in UDP and TCP Server. #2998

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

bdshenker
Copy link
Collaborator

Related Issue(s) 2759
Has Unit Tests (y/n) n
Documentation Included (y/n) n

Change Description

Git ticket #2759 parameterized buffer size in Drv/TcpCllient.
This Git ticket added similar parameterization for Drv/TcpServer and Drv/Udp.

Rationale

This improvement allows the user to customize buffer size. Default is 1024 bytes.

Testing/Review Recommendations

The updates are minor and identical to the ones previously implemented in Drv/TcpClient.
Code logic is not affected. Therefore, no additional unit testing is needed.

Future Work

None.

@@ -27,7 +28,14 @@
SocketIpStatus TcpServerComponentImpl::configure(const char* hostname,
const U16 port,
const U32 send_timeout_seconds,
const U32 send_timeout_microseconds) {
const U32 send_timeout_microseconds,
FwSizeType buffer_size) {

Check notice

Code scanning / CodeQL

Use of basic integral type Note

buffer_size uses the basic integral type unsigned long rather than a typedef with size and signedness.
@@ -161,6 +163,8 @@
Drv::SendStatus send_handler(const NATIVE_INT_TYPE portNum, Fw::Buffer& fwBuffer) override;

Drv::TcpServerSocket m_socket; //!< Socket implementation

FwSizeType m_allocation_size; //!< Member variable to store the buffer size

Check notice

Code scanning / CodeQL

Use of basic integral type Note

m_allocation_size uses the basic integral type unsigned long rather than a typedef with size and signedness.
@@ -32,7 +33,10 @@
return m_socket.configureSend(hostname, port, send_timeout_seconds, send_timeout_microseconds);
}

SocketIpStatus UdpComponentImpl::configureRecv(const char* hostname, const U16 port) {
SocketIpStatus UdpComponentImpl::configureRecv(const char* hostname, const U16 port, FwSizeType buffer_size) {

Check notice

Code scanning / CodeQL

Use of basic integral type Note

hostname uses the basic integral type char rather than a typedef with size and signedness.
@@ -32,7 +33,10 @@
return m_socket.configureSend(hostname, port, send_timeout_seconds, send_timeout_microseconds);
}

SocketIpStatus UdpComponentImpl::configureRecv(const char* hostname, const U16 port) {
SocketIpStatus UdpComponentImpl::configureRecv(const char* hostname, const U16 port, FwSizeType buffer_size) {

Check notice

Code scanning / CodeQL

Use of basic integral type Note

buffer_size uses the basic integral type unsigned long rather than a typedef with size and signedness.
Drv::UdpSocket m_socket; //!< Socket implementation

FwSizeType m_allocation_size; //!< Member variable to store the buffer size

Check notice

Code scanning / CodeQL

Use of basic integral type Note

m_allocation_size uses the basic integral type unsigned long rather than a typedef with size and signedness.
@LeStarch LeStarch self-requested a review October 30, 2024 21:07
@LeStarch LeStarch self-assigned this Oct 30, 2024
Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added one fix (passing m_allocate) to the call.

@LeStarch LeStarch merged commit 0acc49c into nasa:devel Nov 6, 2024
34 checks passed
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.

3 participants