> A shutdown guarantees that the data is transferred from the socket > buf to the TCP buf. The real question here is how you get to the > state you claim is happening: the so isdisconnected() should stall > the calling process until the data has drained, if this is the case, > or it should never get called until the buffer is empty.
I think your fears about data being lost here may be unfounded. The description of soisdisconnected() says: ... soisdisconnected() is called when the connection to the peer is totally severed. This seems to mean that that either the connection has timed out or has been aborted. I think it should be safe to drop any data which is waiting to be sent if connection is actually severed. I've included a list of the places where soisdisconnected is called from, and they all seem pretty final. David. unp_detach unp_disconnect raw_uabort raw_udisconnect ddp_disconnect ddp_abort at_pcbdetach atm_sock_connect (if connect fails) ngs_rmnode div_abort rip_abort tcp_input (TCPS_FIN_WAIT_1 && ourfinisacked) || (TCPS_CLOSING && ourfinisacked) || (TCPS_FIN_WAIT_2 && FIN) tcp_close tcp_usrclosed (and we're in state >= TCPS_FIN_WAIT_2) udp_abort rip6_abort udp6_abort ipx_abort ipx_drop ipx_usr_abort ipx_disconnect spx_close natm_usr_disconnect natm_usrreq for PRU_DISCONNECT idp_abort idp_drop idp_usrreq for PRU_DISCONNECT and PRU_ABORT spp_close To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-net" in the body of the message