Re: TCP assert error logs
Hello Vakul,toggle quoted messageShow quoted text
On Thu, 14 Sep 2017 05:14:55 +0000
Vakul Garg <firstname.lastname@example.org> wrote:
Yes, there's k_poll() which can work with native Zephyr synchronizationYes, POSIX bits is Zephyr are very initial and very bare so far - aI used TCP/UDP POSIX sockets between two local apps just because I
primitives. But synchronization primitives is also what it's limited
to. A net context is not such. You interact with it not by using k_poll,
but by installing callbacks which will be called when something happens.
Then you can do something in a callback (put something in a queue,
release a semaphore, raise an event), and use that with k_poll. But
that's exactly how sockets are implemented!
So, there're few choices:
1. Implement more POSIX synchronization primitives. That would take
some time and effort of course.
2. If needed to be done quickly for experimentation, can use sockets'
net_context::recv_q in k_poll, with a usual warning that it's not
intended to be used like that, and is an implementation detail which can
be changed at any time.
3. The worst way (IMHO) is to duplicate what BSD Sockets already do in
some adhoc code. This way, Zephyr doesn't grow POSIX functionality,
doesn't have its sockets subsystem used, but the adhoc code is all
yours to maintain ;-).
Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog