----- Original Message -----
From: Orlando Andico
To: The Main Philippine Linux Users' Group (PLUG) Discussion List
Sent: Friday, December 23, 2005 3:37 PM
Subject: [plug] number of bytes written?
what happens if the end user times out while i am sending them data?
depends on the nature of its time out be it UDP or TCP.... an appropriate
error number will return to a writing processs...
will the process receive SIGPIPE and die?
sigpipe will generate when you are trying to write to a socket that is not
open or not connected to a peer socket... for not connected to a peer
socket.. this is usually occured when the peer sends an RST tcp packet due
to some error and the sender keeps on sending on it... by default, sigpipe
will terminate the process... catching the sigpipe and either handling the
signal or ignores it... the write operations returns EPIPE error number..
or will the process keep writing data naively and it goes nowhere?
for UDP, since the nature of this protocol is unreliable... it will send
over the wire as long as the nic is ready to send... regardless the link is
down along the path or the peer is down...
for TCP which is a reliable protocol, it will send over the wire and
maintains a copy of that data on its buffer and releases it after receiving
an acknowledgement (ACK) from the peer... if the peer didnt ACK, it will
keep on sending the data (retransmission) from its buffer until a sender
gives up (timeout)...
i seem to have read somewhere (but cannot recall where) that if using
a PerlHandler, it's possible at any given time to figure out how many
bytes you've successfully sent to the remote client. true or false?
the best way to determined how many bytes the write function sent is to get
the return value of that write function call actually sends...
fooler.
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.4/211 - Release Date: 12/22/2005
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph