On 25 Apr 2002, Dave Dykstra <[EMAIL PROTECTED]> wrote: > > The problem is caused because rsync does not close its sockets, and WinSock is a > > quite strict on this. The solution is to shutdown and close the fd. > > This is a 5-minute hack I've done to fix the obvious occurrences of the problem. > > It might be better to extend rsyncs cleanup functions for this, but here it is > > anyway to alert people to the problem and its fix.
> Does anybody know if this might cause problems on non-Windows machines? > Would "shutdown" need to be checked in configure, or is it implemented on > all Unix variants? I don't recall ever seeing a need for it on Unix. >From memory, "Practical TCP Programming" says that this behaviour is caused by a misunderstanding of the sockets API by the WinSock programmers. The correct meaning of shutdown() on Unix is to throw away any outstanding data and close the socket immediately. Normally, when you close a socket, you do want to let any pending data get across, so it's rarely used. On Windows shutdown() does not throw away data, and should be called. (Trust M$ to get it backwards and force everybody else to adapt.) So the patch cannot go in as is, because I think it will break Unix. Something like it can go in, #ifdefed for W32. -- Martin -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.tuxedo.org/~esr/faqs/smart-questions.html