TSocket: bug/feature ?

From: Krzysztof Zelazowski (Krzysztof.Zelazowski@cern.ch)
Date: Fri Jun 11 1999 - 11:33:26 MEST


Version   2.21/08
==================

Dear ROOTers,

I have few questions concerning the TSocket::Send(..) method.
Supposedly we do establish a socket connection between A & B, and kill B
immediately afterwards. Now, when we try to send something from A to B
like:

 root [3] sock->Send("hello")
we get:
 (Int_t)6

Which already is not true, since the connection was broken and I would
expect to receive (-1). However, when we try to send something again
e.g..:

 root [4] sock->Send("hello")
we get:
 *** Break *** write on a pipe with no one to read it
 SysError in <TUnixSystem::UnixSend>: send (Broken pipe)
 Error in <TUnixSystem::SendRaw>: cannot send buffer
(Int_t)(-1)

So my questions are:
 (-) is it a bug, or am I missing some important point in socket
communication

 (-) is it possible to eliminate this message which appears above - in
my program, when I get return value of (-1) I know that we have problems
so I handle the situation, and I would prefer that the user would not be
scared with those messages

 (-) TSocket::IsValid() returns kTRUE in both cases, probably because
the
socket is still opened. However, the documentation does not specify
exactly when IsValid() returns kTRUE, and intuitively to me it's no
longer
valid since we can no longer send things to it.

Thank you in advance for your help,
Krzysztof




This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:34 MET