Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Dave Korn" To: Subject: RE: shutdown( socket, SHUT_WR ) - unexpected behaviour Date: Tue, 4 May 2004 10:20:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: Message-ID: X-OriginalArrivalTime: 04 May 2004 09:20:16.0375 (UTC) FILETIME=[0316C070:01C431B9] > -----Original Message----- > From: cygwin-owner On Behalf Of Arash Partow > Sent: 04 May 2004 07:37 > Hi, > > Just out of curiosity, if one were to do: > > shutdown(sck,SHUT_WR) > > > which means as far as I understand it "stop all send reqs > made to sck", > how would one reopen the sck so that you could make send reqs again? > > Is that even possible or do you have to reestablish the connection > again from scratch? > > I've been looking at the man pages for shutdown on linux and netbsd > and they don't say anything about how you can reverse this effect. In the general case, you can't. shutdown is irreversible and you need to close the socket and open and connect a new one. This is certainly the case for AF_INET sockets, anyway; YMMV with some of the more exotic connection-oriented transports that winsock providers exist for, and I don't know about Unix domain sockets either. But for generic TCP/IP: you can't do it. cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/