Commit Graph

13 Commits

Author SHA1 Message Date
Paul Sokolovsky 81d302b8f8 zephyr/modusocket: Call net_nbuf_print_frags() in recv callback if DEBUG > 1. 2017-04-11 15:25:42 +03:00
Paul Sokolovsky 8ef469f7ca zephyr/modusocket: Implement accept(). 2017-04-08 00:33:09 +03:00
Paul Sokolovsky 96166ec165 zephyr/modusocket: socket_bind: Don't set recv callback on STREAM sockets.
For stream sockets, next exected operation is listen().
2017-04-08 00:30:17 +03:00
Paul Sokolovsky f1c0676a70 zephyr/modusocket: Implement listen(). 2017-04-07 16:47:10 +03:00
Paul Sokolovsky 1da8404647 modusocket: Handle a case when recv_q is empty when EOF is signaled.
In this case, we can mark socket as closed directly.
2017-04-06 10:12:14 +03:00
Paul Sokolovsky faf333c04f zephyr/modusocket: Factor out "extended k_fifo API".
Internal structure of k_fifo changed between 1.7 and 1.8, so we need
to abstract it away. This adds more functions than currently used, for
future work.
2017-04-05 13:39:16 +03:00
Paul Sokolovsky 2908c3ca41 zephyr/modusocket: Factor out socket_new() function.
It will be reused e.g. for accept() implementation.
2017-04-04 06:28:14 +03:00
Paul Sokolovsky 6e99a8c94e zephyr/modusocket: Be sure to use MP_OBJ_FROM_PTR. 2017-04-04 06:21:09 +03:00
Paul Sokolovsky ca81c3ab0b zephyr/modusocket: Implement recv() for TCP sockets.
Short read approach is taken - at most, the remaining data in the current
fragment will be returned.
2017-04-02 16:27:09 +03:00
Paul Sokolovsky 3df65e9bae zephyr/modusocket: Implement recv() for UDP sockets.
The foundation of recv() support is per-socket queue of incoming packets,
implemented using Zephyr FIFO object. This patch implements just recv()
for UDP, because TCP recv() requires much more fine-grained control of
network fragments and handling other issues, like EOF condition, etc.
2017-04-01 09:20:17 +03:00
Paul Sokolovsky 64d00511e1 zephyr/modusocket: Implement send(). 2017-03-31 23:14:39 +03:00
Paul Sokolovsky 88582e33cc zephyr/modusocket: Implement bind() and connect(). 2017-03-31 23:02:41 +03:00
Paul Sokolovsky d1015f0e0d zephyr/modusocket: Initial version of usocket module for Zephyr.
So far, socket creation and closure is implemented.
2017-03-31 00:04:31 +03:00