net/tcp/tcp_netpoll.c: Monitor TCP_POLL/TCP_NEWDATA/TCP_BACKLOG per the request like UDP counterpart.

This commit is contained in:
Xiang Xiao 2019-11-24 10:20:01 -06:00 committed by Gregory Nutt
parent 893fc6e1cf
commit 673f812c4e

View File

@ -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.
*/