Re: [PATCH 01/10] server: allow polling for no events in set_fd_events

2010-04-09 Thread Mike Kaplinskiy
On Thu, Apr 8, 2010 at 8:29 PM, Alexandre Julliard wrote: > Mike Kaplinskiy writes: > >> This won't work for implementing half-closed sockets. If we have only >> the read half is closed, we will get POLLIN/0 recv indefinitely if we >> keep polling (not POLLHUP). If we remove it from the loop, we

Re: [PATCH 01/10] server: allow polling for no events in set_fd_events

2010-04-08 Thread Alexandre Julliard
Mike Kaplinskiy writes: > This won't work for implementing half-closed sockets. If we have only > the read half is closed, we will get POLLIN/0 recv indefinitely if we > keep polling (not POLLHUP). If we remove it from the loop, we have to > keep polling (once in a while, i.e. when an enable_sock

Re: [PATCH 01/10] server: allow polling for no events in set_fd_events

2010-04-08 Thread Mike Kaplinskiy
On Thu, Apr 8, 2010 at 11:16 AM, Alexandre Julliard wrote: > Mike Kaplinskiy writes: > >> But I see your point that perhaps it doesn't belong in the main loop >> when one of the halves gets closed. I guess we can keep sock_try_event >> around but only use it when the socket has been removed from

Re: [PATCH 01/10] server: allow polling for no events in set_fd_events

2010-04-08 Thread Alexandre Julliard
Mike Kaplinskiy writes: > But I see your point that perhaps it doesn't belong in the main loop > when one of the halves gets closed. I guess we can keep sock_try_event > around but only use it when the socket has been removed from the main > loop. I'll also add detection of half-closed connection

Re: [PATCH 01/10] server: allow polling for no events in set_fd_events

2010-04-07 Thread Mike Kaplinskiy
On Tue, Apr 6, 2010 at 2:03 PM, Alexandre Julliard wrote: > Mike Kaplinskiy writes: > >> Would allowing adding the fd to the poll loop after it has been >> removed be more sane? Otherwise we have to resort to ugly things like >> sock_try_event (which only half work). > > I don't think that makes

Re: [PATCH 01/10] server: allow polling for no events in set_fd_events

2010-04-06 Thread Alexandre Julliard
Mike Kaplinskiy writes: > Would allowing adding the fd to the poll loop after it has been > removed be more sane? Otherwise we have to resort to ugly things like > sock_try_event (which only half work). I don't think that makes sense either. The error condition is not going to go away so you can

Re: [PATCH 01/10] server: allow polling for no events in set_fd_events

2010-04-06 Thread Mike Kaplinskiy
On Tue, Apr 6, 2010 at 1:08 PM, Alexandre Julliard wrote: > Mike Kaplinskiy writes: > >> Remove the fd from the poll list so we don't get POLLHUP/POLLERR >> messages when we ask for no events > > This is wrong, even when selecting for no events you want to receive > POLLHUP/POLLERR. If you really

Re: [PATCH 01/10] server: allow polling for no events in set_fd_events

2010-04-06 Thread Alexandre Julliard
Mike Kaplinskiy writes: > Remove the fd from the poll list so we don't get POLLHUP/POLLERR > messages when we ask for no events This is wrong, even when selecting for no events you want to receive POLLHUP/POLLERR. If you really don't want any events you have to use -1 to remove the fd from the l