[PATCH 1/1] evio: allow not only SOCK_STREAM servers

Vladimir Davydov vdavydov.dev at gmail.com
Tue Dec 18 13:08:30 MSK 2018


On Mon, Dec 17, 2018 at 02:55:44PM +0300, Vladislav Shpilevoy wrote:
> evio is a useful tool for creating servers. Evio sets
> all necessary flags, retries bind, parses URI. But it
> does not work with SOCK_DGRAM sockets - SOCK_STREAM is
> hardcoded. SWIM is going to use SOCK_DGRAM, and this
> patch makes it possible to bind datagram sockets.
> 
> Needed for #3234
> ---
> https://github.com/tarantool/tarantool/tree/gerold103/gh-3234-swim-second-preparation
> https://github.com/tarantool/tarantool/issues/3234
> 
>  src/box/iproto.cc |  4 ++--
>  src/coio.cc       |  4 ++--
>  src/evio.c        | 48 +++++++++++++++++++++++++++++++++++------------
>  src/evio.h        | 19 ++++++++++++++++---
>  4 files changed, 56 insertions(+), 19 deletions(-)

I don't think it's a good idea to reuse evio_service_bind() for SWIM
configuration as it's blocking (it uses getaddrinfo). Anyway, do we
really need this extra level of abstraction? Wouldn't it be more
straightforward to use sio/ev/coio directly instead?



More information about the Tarantool-patches mailing list