Skip to content

Conversation

@jukkar
Copy link
Member

@jukkar jukkar commented Oct 16, 2017

Use the remote address to determine what address family to bind.
This prevents extra context to be created.

Signed-off-by: Jukka Rissanen [email protected]

Copy link
Contributor

Choose a reason for hiding this comment

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

There's also "peer_addr" arg to this function (net_app_init_client), shouldn't it be consulted to avoid extra name resolution run?

Also, later we'd need to resolve peer_addr_str anyway, so make sense to do that once, though looking at the code, that would require heavier refactoring of the code...

@jukkar
Copy link
Member Author

jukkar commented Oct 17, 2017

New version uploaded, I also added simple unit tests that test the refactored client APIs.

Use the remote address to determine what address family to bind.
This prevents extra context to be created. In order to avoid
parsing the peer address string multiple times, the client
init function is re-factored.

Signed-off-by: Jukka Rissanen <[email protected]>
If there is no connection to server, then _net_app_select_net_ctx()
will return NULL. This is perfectly fine and we can just continue.

Signed-off-by: Jukka Rissanen <[email protected]>
@jukkar jukkar force-pushed the net-app-fix branch 2 times, most recently from 6c7c731 to 8a334a9 Compare October 17, 2017 14:18
Copy link
Contributor

@pfalcon pfalcon left a comment

Choose a reason for hiding this comment

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

Thanks for taking care to refactor remote addr resolving!

Few nRF51 board tests fail due to RAM overflow though, I guess this is not directly related to the refactor per se, so just need do be excluded based on low RAM.

These are simple tests for net-app testing. These do not try to
actually send anything to net but test mainly net-app setup and
close functionality.

Signed-off-by: Jukka Rissanen <[email protected]>
@nashif nashif merged commit faeab7f into zephyrproject-rtos:master Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants