This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: shutdown( socket, SHUT_WR ) - unexpected behaviour


> -----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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]