-
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
#2074 Parameterize buffer size in UDP and TCP Server. #2998
base: devel
Are you sure you want to change the base?
Conversation
@@ -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
@@ -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
@@ -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
@@ -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
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
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.