Fix return value of GetEndpoint() #110
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The socket struct has two fields for endpoints, a local and a remote endpoint. These files have always been Null, so the get request to these fields always returned Null. This makes it impossible to use methods like SendTo() and ReceiveFrom().
Motivation and Context
Nevertheless, the send() and receive() methods worked correctly. But sometimes it is necessary to determine the IP and port address of a connected device.
The problem was that there were two endpoints defined and initialized with Null in the GetEndPoint() method. Only one of them got updated but then the other one was used as return value. I removed the first one and adjusted the return value.
How Has This Been Tested?
This has been tested with a custom STM32F427 based MCU board with network interface. Both client and server modes have been used as test applications.
Types of changes
Checklist:
Signed-off-by: Martin Kuhn martin.kuhn@csa.ch