On Thu, 6 Jul 1995 09:37:00 PDT Dan said:
>Is there any way to _ensure_ the data has been sent and to the remote end
>and ACK'd before the connection is released? Graceful shutdown of sockets
>doesn't seem to work -- data still gets dropped (but no error is reported).
You do a graceful shutdown, then read from the socket until you get an
error, then do a "shutdown dammit". If I recall correctly, well, what
the heck, let me go find that code snippet..... here ya go:
close_vsocket(void)
{
int i,flags;
IPCSHUTDOWN(virt_desc,&graceful,NULL,&ipcerror);
/* while no error, flush received data */
while (!ipcerror)
{
i = 1;
flags = 0x4; /* Discard remaining data */
IPCRECV(virt_desc,&data.buffer,&i,&flags,NULL,&ipcerror);
}
/* Following check for graceful or remote abort removed so that
we always shutdown forcefully. MPE/iX 4.0 was *not* releasing
it's sockets even after the checks below passed (Jeff,4/11/94)
if ((ipcerror != 64) && (ipcerror != 68)) */
IPCSHUTDOWN(virt_desc); /* Forced shutdown */
} /* end of close_vsocket() */
[\] Jeff Kell <[log in to unmask]>
|