|
Shutdown(): Usage Notes Issuing a shutdown() with a how parameter of 0 causes any new data received for the socket to be discarded. Any input functions for this socket complete with a 0, meaning that end-of-file has been reached. On a BSD implementation, if the socket is being shared across multiple processes, any blocking input operations are deblocked by this action. However, the OS/400 sockets implementation of shutdown() does not cause these blocked functions to be deblocked. Issuing a shutdown() with a how parameter of 1 results in all output functions being failed with an error of [epipe]. The process issuing the output operation will receive a synchronous sigpipe signal. This also sends a normal close sequence to the partner program. Receive operations issued by the partner program receive a return value of 0 once all previous data has been received. On a BSD implementation, if the socket is being shared across multiple processes or threads, any blocking output functions are deblocked with a return value of -1 and an error code of [epipe]. However, the OS/400 sockets implementation of shutdown() does not cause these blocked functions to be deblocked. Issuing a shutdown() with a how parameter of 2 results in the actions listed for a how parameter of 0 being performed first, followed by the actions listed for a how parameter of 1. Issuing a shutdown() on socket connected through a SOCKS server is not supported. When you develop in C-based languages and an application is compiled with the _XOPEN_SOURCE macro defined to the value 520 or greater, the shutdown() API is mapped to qso_shutdown98(). Chris Bipes Information Services Director CrossCheck, Inc. -----Original Message----- From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of David Gibbs Sent: Monday, October 24, 2005 2:26 PM To: Midrange Systems Technical Discussion Subject: Re: Sniff TCP/IP traffic on iSeries? On Mon, October 24, 2005 4:04 pm, Scott Klement said: > a) Sometimes they forget to add a CR/LF. This causes the whole process > to stop and wait for the CRLF. > b) the send() and recv() APIs (or, the read() and write() APIs, which > work exactly the same) do not send fixed-length data on a stream socket. My code uses shutdown() to indicate that the sending is done. We don't rely on fixed length or even data terminators to determine when the data is finished. david
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.