-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Refactor Drv::Ip::UdpSocket to clean up state members and remove dependency on dynamic memory #3728
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
Changes from 4 commits
42fbdec
85b4568
5d00932
006f2f6
574dba4
484c5b9
70be688
8987394
401908a
2e68490
319b38e
9ac24cd
5a2e11d
9a29699
7bc3ab2
eb73a9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,18 @@ | |
| #include <Drv/Ip/IpSocket.hpp> | ||
| #include <config/IpCfg.hpp> | ||
|
|
||
| namespace Drv { | ||
| // Include system headers for sockaddr_in | ||
| #ifdef TGT_OS_TYPE_VXWORKS | ||
| #include <socket.h> | ||
| #include <inetLib.h> | ||
| #elif defined TGT_OS_TYPE_LINUX || TGT_OS_TYPE_DARWIN | ||
|
||
| #include <sys/socket.h> | ||
| #include <arpa/inet.h> | ||
| #else | ||
| #error OS not supported for IP Socket Communications | ||
| #endif | ||
|
|
||
| struct SocketState; | ||
| namespace Drv { | ||
|
|
||
| /** | ||
| * \brief Helper for setting up Udp using Berkeley sockets as a client | ||
|
|
@@ -122,9 +131,8 @@ class UdpSocket : public IpSocket { | |
| */ | ||
| I32 recvProtocol(const SocketDescriptor& socketDescriptor, U8* const data, const U32 size) override; | ||
| private: | ||
| SocketState* m_state; //!< State storage | ||
| U16 m_recv_port; //!< Port to receive on | ||
| CHAR m_recv_hostname[SOCKET_MAX_HOSTNAME_SIZE]; //!< Hostname to receive on | ||
| struct sockaddr_in m_addr_send; //!< UDP server address for sending | ||
| struct sockaddr_in m_addr_recv; //!< UDP server address for receiving | ||
| bool m_recv_configured; //!< True if configureRecv was called | ||
| }; | ||
| } // namespace Drv | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.