diff --git a/net/tcp/tcp_netpoll.c b/net/tcp/tcp_netpoll.c index b1d37f3135..046f1993e9 100644 --- a/net/tcp/tcp_netpoll.c +++ b/net/tcp/tcp_netpoll.c @@ -364,10 +364,20 @@ int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds) * callback processing. */ - cb->flags = (TCP_NEWDATA | TCP_BACKLOG | TCP_POLL | TCP_DISCONN_EVENTS); + cb->flags = TCP_DISCONN_EVENTS; cb->priv = (FAR void *)info; cb->event = tcp_poll_eventhandler; + if ((fds->events & POLLOUT) != 0) + { + cb->flags |= TCP_POLL; + } + + if ((fds->events & POLLIN) != 0) + { + cb->flags |= TCP_NEWDATA | TCP_BACKLOG; + } + /* Save the reference in the poll info structure as fds private as well * for use during poll teardown as well. */