// @(#)root/proofx:$Id$
// Author: Gerardo Ganis  12/12/2005

/*************************************************************************
 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TXSocket                                                             //
//                                                                      //
// High level handler of connections to xproofd.                        //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "MessageTypes.h"
#include "TEnv.h"
#include "TError.h"
#include "TException.h"
#include "TMonitor.h"
#include "TObjString.h"
#include "TProof.h"
#include "TSlave.h"
#include "TRegexp.h"
#include "TROOT.h"
#include "TUrl.h"
#include "TXHandler.h"
#include "TXSocket.h"
#include "XProofProtocol.h"

#include "XrdProofConn.h"

#include "XrdClient/XrdClientConnMgr.hh"
#include "XrdClient/XrdClientConst.hh"
#include "XrdClient/XrdClientEnv.hh"
#include "XrdClient/XrdClientLogConnection.hh"
#include "XrdClient/XrdClientMessage.hh"

#ifndef WIN32
#include <sys/socket.h>
#else
#include <Winsock2.h>
#endif


#include "XpdSysError.h"
#include "XpdSysLogger.h"

// ---- Tracing utils ----------------------------------------------------------
#include "XrdProofdTrace.h"
XrdOucTrace *XrdProofdTrace = 0;
static XrdSysLogger eLogger;
static XrdSysError eDest(0, "Proofx");

#ifdef WIN32
ULong64_t TSocket::fgBytesSent;
ULong64_t TSocket::fgBytesRecv;
#endif

//______________________________________________________________________________

//---- error handling ----------------------------------------------------------

//______________________________________________________________________________
void TXSocket::DoError(int level, const char *location, const char *fmt, va_list va) const
{
   // Interface to ErrorHandler (protected).

   ::ErrorHandler(level, Form("TXSocket::%s", location), fmt, va);
}

//----- Ping handler -----------------------------------------------------------
//______________________________________________________________________________
class TXSocketPingHandler : public TFileHandler {
   TXSocket  *fSocket;
public:
   TXSocketPingHandler(TXSocket *s, Int_t fd)
      : TFileHandler(fd, 1) { fSocket = s; }
   Bool_t Notify();
   Bool_t ReadNotify() { return Notify(); }
};

//______________________________________________________________________________
Bool_t TXSocketPingHandler::Notify()
{
   // Ping the socket
   fSocket->Ping("ping handler");

   return kTRUE;
}

// Env variables init flag
Bool_t TXSocket::fgInitDone = kFALSE;

// Static variables for input notification
TXSockPipe   TXSocket::fgPipe;               // Pipe for input monitoring
TString      TXSocket::fgLoc = "undef";      // Location string

// Static buffer manager
TMutex       TXSocket::fgSMtx;               // To protect spare list
std::list<TXSockBuf *> TXSocket::fgSQue;     // list of spare buffers
Long64_t     TXSockBuf::fgBuffMem = 0;       // Total allocated memory
Long64_t     TXSockBuf::fgMemMax = 10485760; // Max allowed allocated memory [10 MB]

//_____________________________________________________________________________
TXSocket::TXSocket(const char *url, Char_t m, Int_t psid, Char_t capver,
                   const char *logbuf, Int_t loglevel, TXHandler *handler)
         : TSocket(), fMode(m), fLogLevel(loglevel),
           fBuffer(logbuf), fConn(0), fASem(0), fAsynProc(1),
           fDontTimeout(kFALSE), fRDInterrupt(kFALSE), fXrdProofdVersion(-1)
{
   // Constructor
   // Open the connection to a remote XrdProofd instance and start a PROOF
   // session.
   // The mode 'm' indicates the role of this connection:
   //     'a'      Administrator; used by an XPD to contact the head XPD
   //     'i'      Internal; used by a TXProofServ to call back its creator
   //              (see XrdProofUnixConn)
   //     'C'      PROOF manager: open connection only (do not start a session)
   //     'M'      Client creating a top master
   //     'A'      Client attaching to top master
   //     'm'      Top master creating a submaster
   //     's'      Master creating a slave
   // The buffer 'logbuf' is a null terminated string to be sent over at
   // login.

   fUrl = url;
   // Enable tracing in the XrdProof client. if not done already
   eDest.logger(&eLogger);
   if (!XrdProofdTrace)
      XrdProofdTrace = new XrdOucTrace(&eDest);

   // Init envs the first time
   if (!fgInitDone)
      InitEnvs();

   // Async queue related stuff
   if (!(fAMtx = new TMutex(kTRUE))) {
      Error("TXSocket", "problems initializing mutex for async queue");
      return;
   }
   fAQue.clear();

   // Interrupts queue related stuff
   if (!(fIMtx = new TMutex(kTRUE))) {
      Error("TXSocket", "problems initializing mutex for interrupts");
      return;
   }
   fILev = -1;
   fIForward = kFALSE;

   // Init some variables
   fByteLeft = 0;
   fByteCur = 0;
   fBufCur = 0;
   fServType = kPROOFD; // for consistency
   fTcpWindowSize = -1;
   fRemoteProtocol = -1;
   // By default forward directly to end-point
   fSendOpt = (fMode == 'i') ? (kXPD_internal | kXPD_async) : kXPD_async;
   fSessionID = (fMode == 'C') ? -1 : psid;
   fSocket = -1;

   // This is used by external code to create a link between this object
   // and another one
   fReference = 0;

   // The global pipe
   if (!fgPipe.IsValid()) {
      Error("TXSocket", "internal pipe is invalid");
      return;
   }

   // Some initial values
   TUrl u(url);
   fAddress = gSystem->GetHostByName(u.GetHost());
   u.SetProtocol("proof", kTRUE);
   fAddress.fPort = (u.GetPort() > 0) ? u.GetPort() : 1093;

   // Set the asynchronous handler
   fHandler = handler;

   if (url) {

      // Create connection (for managers the type of the connection is the same
      // as for top masters)
      char md = (fMode !='A' && fMode !='C') ? fMode : 'M';
      fConn = new XrdProofConn(url, md, psid, capver, this, fBuffer.Data());
      if (!fConn || !(fConn->IsValid())) {
         if (fConn->GetServType() != XrdProofConn::kSTProofd)
            if (gDebug > 0)
               Error("TXSocket", "fatal error occurred while opening a connection"
                                 " to server [%s]: %s", url, fConn->GetLastErr());
         return;
      }

      // Fill some info
      fUser = fConn->fUser.c_str();
      fHost = fConn->fHost.c_str();
      fPort = fConn->fPort;

      // Create new proofserv if not client manager or administrator or internal mode
      if (fMode == 'm' || fMode == 's' || fMode == 'M' || fMode == 'A'|| fMode == 'L') {
         // We attach or create
         if (!Create()) {
            // Failure
            Error("TXSocket", "create or attach failed (%s)",
                  ((fConn->fLastErrMsg.length() > 0) ? fConn->fLastErrMsg.c_str() : "-"));
            Close();
            return;
         }
      }

      // Fill some other info available if Create is successful
      if (fMode == 'C') {
         fXrdProofdVersion = fConn->fRemoteProtocol;
         fRemoteProtocol = fConn->fRemoteProtocol;
      }

      // Also in the base class
      fUrl = fConn->fUrl.GetUrl().c_str();
      fAddress = gSystem->GetHostByName(fConn->fUrl.Host.c_str());
      fAddress.fPort = fPort;

      // This is needed for the reader thread to signal an interrupt
      fPid = gSystem->GetPid();
   }
}

#if 0
//______________________________________________________________________________
TXSocket::TXSocket(const TXSocket &s) : TSocket(s),XrdClientAbsUnsolMsgHandler(s)
{
   // TXSocket copy ctor.
}

//______________________________________________________________________________
TXSocket& TXSocket::operator=(const TXSocket&)
{
   // TXSocket assignment operator.
   return *this;
}
#endif

//_____________________________________________________________________________
TXSocket::~TXSocket()
{
   // Destructor

   // Disconnect from remote server (the connection manager is
   // responsible of the underlying physical connection, so we do not
   // force its closing)
   Close();

   // Delete mutexes
   SafeDelete(fAMtx);
   SafeDelete(fIMtx);
}

//______________________________________________________________________________
void TXSocket::SetLocation(const char *loc)
{
   // Set location string

   if (loc) {
      fgLoc = loc;
      fgPipe.SetLoc(loc);
   } else {
      fgLoc = "";
      fgPipe.SetLoc("");
   }
}

//_____________________________________________________________________________
void TXSocket::SetSessionID(Int_t id)
{
   // Set session ID to 'id'. If id < 0, disable also the asynchronous handler.

   if (id < 0 && fConn)
      fConn->SetAsync(0);
   fSessionID = id;
}

//_____________________________________________________________________________
void TXSocket::DisconnectSession(Int_t id, Option_t *opt)
{
   // Disconnect a session. Use opt= "S" or "s" to
   // shutdown remote session.
   // Default is opt = "".

   // Make sure we are connected
   if (!IsValid()) {
      if (gDebug > 0)
         Info("DisconnectSession","not connected: nothing to do");
      return;
   }

   Bool_t shutdown = opt && (strchr(opt,'S') || strchr(opt,'s'));
   Bool_t all = opt && (strchr(opt,'A') || strchr(opt,'a'));

   if (id > -1 || all) {
      // Prepare request
      XPClientRequest Request;
      memset(&Request, 0, sizeof(Request) );
      fConn->SetSID(Request.header.streamid);
      if (shutdown)
         Request.proof.requestid = kXP_destroy;
      else
         Request.proof.requestid = kXP_detach;
      Request.proof.sid = id;

      // Send request
      XrdClientMessage *xrsp =
         fConn->SendReq(&Request, (const void *)0, 0, "DisconnectSession");

      // Print error msg, if any
      if (!xrsp && fConn->GetLastErr())
         Printf("%s: %s", fHost.Data(), fConn->GetLastErr());

      // Cleanup
      SafeDelete(xrsp);
   }
}

//_____________________________________________________________________________
void TXSocket::Close(Option_t *opt)
{
   // Close connection. Available options are (case insensitive)
   //   'P'   force closing of the underlying physical connection
   //   'S'   shutdown remote session, is any
   // A session ID can be given using #...# signature, e.g. "#1#".
   // Default is opt = "".

   Int_t to = gEnv->GetValue("XProof.AsynProcSemTimeout", 60);
   if (fAsynProc.Wait(to*1000) != 0)
      Warning("Close", "could not hold semaphore for async messages after %d sec: closing anyhow (may give error messages)", to);

   // Remove any reference in the global pipe and ready-sock queue
   TXSocket::fgPipe.Flush(this);

   // Make sure we have a connection
   if (!fConn) {
      if (gDebug > 0)
         Info("Close","no connection: nothing to do");
      fAsynProc.Post();
      return;
   }

   // Disconnect the asynchronous requests handler
   fConn->SetAsync(0);

   // If we are connected we disconnect
   if (IsValid()) {

      // Parse options
      TString o(opt);
      Int_t sessID = fSessionID;
      if (o.Index("#") != kNPOS) {
         o.Remove(0,o.Index("#")+1);
         if (o.Index("#") != kNPOS) {
            o.Remove(o.Index("#"));
            sessID = o.IsDigit() ? o.Atoi() : sessID;
         }
      }

      if (sessID > -1) {
         // Warn the remote session, if any (after destroy the session is gone)
         DisconnectSession(sessID, opt);
      } else {
         // We are the manager: close underlying connection
         fConn->Close(opt);
      }
   }

   // Delete the connection module
   SafeDelete(fConn);

   // Post semaphore
   fAsynProc.Post();
}

//_____________________________________________________________________________
UnsolRespProcResult TXSocket::ProcessUnsolicitedMsg(XrdClientUnsolMsgSender *,
                                                    XrdClientMessage *m)
{
   // We are here if an unsolicited response comes from a logical conn
   // The response comes in the form of an XrdClientMessage *, that must NOT be
   // destroyed after processing. It is destroyed by the first sender.
   // Remember that we are in a separate thread, since unsolicited
   // responses are asynchronous by nature.
   UnsolRespProcResult rc = kUNSOL_KEEP;

   // If we are closing we will not do anything
   TXSemaphoreGuard semg(&fAsynProc);
   if (!semg.IsValid()) {
      Error("ProcessUnsolicitedMsg", "%p: async semaphore taken by Close()! Should not be here!", this);
      return kUNSOL_CONTINUE;
   }

   if (!m) {
      if (gDebug > 2)
         Info("ProcessUnsolicitedMsg", "%p: got empty message: skipping", this);
      // Some one is perhaps interested in empty messages
      return kUNSOL_CONTINUE;
   } else {
      if (gDebug > 2)
         Info("ProcessUnsolicitedMsg", "%p: got message with status: %d, len: %d bytes (ID: %d)",
              this, m->GetStatusCode(), m->DataLen(), m->HeaderSID());
   }

   // Error notification
   if (m->IsError()) {
      if (m->GetStatusCode() != XrdClientMessage::kXrdMSC_timeout) {
         if (gDebug > 0)
            Info("ProcessUnsolicitedMsg","%p: got error from underlying connection", this);
         XHandleErr_t herr = {1, 0};
         if (!fHandler || fHandler->HandleError((const void *)&herr)) {
            if (gDebug > 0)
               Info("ProcessUnsolicitedMsg","%p: handler undefined or recovery failed", this);
            // Avoid to contact the server any more
            fSessionID = -1;
         } else {
            // Connection still usable: update usage timestamp
            Touch();
         }
      } else {
         // Time out
         if (gDebug > 2)
            Info("ProcessUnsolicitedMsg", "%p: underlying connection timed out", this);
      }
      // Propagate the message to other possible handlers
      return kUNSOL_CONTINUE;
   }

   // From now on make sure is for us (but only if not during setup, i.e. fConn == 0; otherwise
   // we may miss some important server message)
   if (fConn && !m->MatchStreamid(fConn->fStreamid)) {
      if (gDebug > 1)
         Info("ProcessUnsolicitedMsg", "%p: IDs do not match: {%d, %d}", this, fConn->fStreamid, m->HeaderSID());
      return kUNSOL_CONTINUE;
   }

   // Local processing ...
   Int_t len = 0;
   if ((len = m->DataLen()) < (int)sizeof(kXR_int32)) {
      Error("ProcessUnsolicitedMsg", "empty or bad-formed message - disabling");
      PostMsg(kPROOF_STOP);
      return rc;
   }

   // Activity on the line: update usage timestamp
   Touch();

   // The first 4 bytes contain the action code
   kXR_int32 acod = 0;
   memcpy(&acod, m->GetData(), sizeof(kXR_int32));
   if (acod > 10000)
         Info("ProcessUnsolicitedMsg", "%p: got acod %d (%x): message has status: %d, len: %d bytes (ID: %d)",
              this, acod, acod, m->GetStatusCode(), m->DataLen(), m->HeaderSID());
   //
   // Update pointer to data
   void *pdata = (void *)((char *)(m->GetData()) + sizeof(kXR_int32));
   len -= sizeof(kXR_int32);
   if (gDebug > 1)
      Info("ProcessUnsolicitedMsg", "%p: got action: %d (%d bytes) (ID: %d)",
           this, acod, len, m->HeaderSID());

   if (gDebug > 3)
      fgPipe.DumpReadySock();

   // Case by case
   kXR_int32 ilev = -1;
   const char *lab = 0;

   switch (acod) {
      case kXPD_ping:
         //
         // Special interrupt
         ilev = TProof::kPing;
         lab = "kXPD_ping";
      case kXPD_interrupt:
         //
         // Interrupt
         lab = !lab ? "kXPD_interrupt" : lab;
         { R__LOCKGUARD(fIMtx);
            if (acod == kXPD_interrupt) {
               memcpy(&ilev, pdata, sizeof(kXR_int32));
               ilev = net2host(ilev);
               // Update pointer to data
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            }
            // The next 4 bytes contain the forwarding option
            kXR_int32 ifw = 0;
            if (len > 0) {
               memcpy(&ifw, pdata, sizeof(kXR_int32));
               ifw = net2host(ifw);
               if (gDebug > 1)
                  Info("ProcessUnsolicitedMsg","%s: forwarding option: %d", lab, ifw);
            }
            //
            // Save the interrupt
            fILev = ilev;
            fIForward = (ifw == 1) ? kTRUE : kFALSE;

            // Handle this input in this thread to avoid queuing on the
            // main thread
            XHandleIn_t hin = {acod, 0, 0, 0};
            if (fHandler)
               fHandler->HandleInput((const void *)&hin);
            else
               Error("ProcessUnsolicitedMsg","handler undefined");
         }
         break;
      case kXPD_timer:
         //
         // Set shutdown timer
         {
            kXR_int32 opt = 1;
            kXR_int32 delay = 0;
            // The next 4 bytes contain the shutdown option
            if (len > 0) {
               memcpy(&opt, pdata, sizeof(kXR_int32));
               opt = net2host(opt);
               if (gDebug > 1)
                  Info("ProcessUnsolicitedMsg","kXPD_timer: found opt: %d", opt);
               // Update pointer to data
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            }
            // The next 4 bytes contain the delay
            if (len > 0) {
               memcpy(&delay, pdata, sizeof(kXR_int32));
               delay = net2host(delay);
               if (gDebug > 1)
                  Info("ProcessUnsolicitedMsg","kXPD_timer: found delay: %d", delay);
               // Update pointer to data
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            }

            // Handle this input in this thread to avoid queuing on the
            // main thread
            XHandleIn_t hin = {acod, opt, delay, 0};
            if (fHandler)
               fHandler->HandleInput((const void *)&hin);
            else
               Error("ProcessUnsolicitedMsg","handler undefined");
         }
         break;
      case kXPD_inflate:
         //
         // Set inflate factor
         {
            kXR_int32 inflate = 1000;
            if (len > 0) {
               memcpy(&inflate, pdata, sizeof(kXR_int32));
               inflate = net2host(inflate);
               if (gDebug > 1)
                  Info("ProcessUnsolicitedMsg","kXPD_inflate: factor: %d", inflate);
               // Update pointer to data
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            }
            // Handle this input in this thread to avoid queuing on the
            // main thread
            XHandleIn_t hin = {acod, inflate, 0, 0};
            if (fHandler)
               fHandler->HandleInput((const void *)&hin);
            else
               Error("ProcessUnsolicitedMsg","handler undefined");
         }
         break;
      case kXPD_priority:
         //
         // Broadcast group priority
         {
            kXR_int32 priority = -1;
            if (len > 0) {
               memcpy(&priority, pdata, sizeof(kXR_int32));
               priority = net2host(priority);
               if (gDebug > 1)
                  Info("ProcessUnsolicitedMsg","kXPD_priority: priority: %d", priority);
               // Update pointer to data
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            }
            // Handle this input in this thread to avoid queuing on the
            // main thread
            XHandleIn_t hin = {acod, priority, 0, 0};
            if (fHandler)
               fHandler->HandleInput((const void *)&hin);
            else
               Error("ProcessUnsolicitedMsg","handler undefined");
         }
         break;
      case kXPD_flush:
         //
         // Flush request
         {
            // Handle this input in this thread to avoid queuing on the
            // main thread
            XHandleIn_t hin = {acod, 0, 0, 0};
            if (fHandler)
               fHandler->HandleInput((const void *)&hin);
            else
               Error("ProcessUnsolicitedMsg","handler undefined");
         }
         break;
      case kXPD_urgent:
         //
         // Set shutdown timer
         {
            // The next 4 bytes contain the urgent msg type
            kXR_int32 type = -1;
            if (len > 0) {
               memcpy(&type, pdata, sizeof(kXR_int32));
               type = net2host(type);
               if (gDebug > 1)
                  Info("ProcessUnsolicitedMsg","kXPD_urgent: found type: %d", type);
               // Update pointer to data
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            }
            // The next 4 bytes contain the first info container
            kXR_int32 int1 = -1;
            if (len > 0) {
               memcpy(&int1, pdata, sizeof(kXR_int32));
               int1 = net2host(int1);
               if (gDebug > 1)
                  Info("ProcessUnsolicitedMsg","kXPD_urgent: found int1: %d", int1);
               // Update pointer to data
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            }
            // The next 4 bytes contain the second info container
            kXR_int32 int2 = -1;
            if (len > 0) {
               memcpy(&int2, pdata, sizeof(kXR_int32));
               int2 = net2host(int2);
               if (gDebug > 1)
                  Info("ProcessUnsolicitedMsg","kXPD_urgent: found int2: %d", int2);
               // Update pointer to data
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            }

            // Handle this input in this thread to avoid queuing on the
            // main thread
            XHandleIn_t hin = {acod, type, int1, int2};
            if (fHandler)
               fHandler->HandleInput((const void *)&hin);
            else
               Error("ProcessUnsolicitedMsg","handler undefined");
         }
         break;
      case kXPD_msg:
         //
         // Data message
         {  R__LOCKGUARD(fAMtx);

            // Get a spare buffer
            TXSockBuf *b = PopUpSpare(len);
            if (!b) {
               Error("ProcessUnsolicitedMsg","could allocate spare buffer");
               return rc;
            }
            memcpy(b->fBuf, pdata, len);
            b->fLen = len;

            // Update counters
            fBytesRecv += len;

            // Produce the message
            fAQue.push_back(b);

            // Post the global pipe
            fgPipe.Post(this);

            // Signal it and release the mutex
            if (gDebug > 2)
               Info("ProcessUnsolicitedMsg","%p: %s: posting semaphore: %p (%d bytes)",
                                            this, GetTitle(), &fASem, len);
            fASem.Post();
         }

         break;
      case kXPD_feedback:
         Info("ProcessUnsolicitedMsg",
              "kXPD_feedback treatment not yet implemented");
         break;
      case kXPD_srvmsg:
         //
         // Service message
         {
            // The next 4 bytes may contain a flag to control the way the message is displayed
            kXR_int32 opt = 0;
            memcpy(&opt, pdata, sizeof(kXR_int32));
            opt = net2host(opt);
            if (opt >= 0 && opt <= 4) {
               // Update pointer to data
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            } else {
               opt = 1;
            }

            if (opt == 0) {
               // One line
               Printf("| %.*s", len, (char *)pdata);
            } else if (opt == 2) {
               // Raw displaying
               Printf("%.*s", len, (char *)pdata);
            } else if (opt == 3) {
               // Incremental displaying
               fprintf(stderr, "%.*s", len, (char *)pdata);
            } else if (opt == 4) {
               // Rewind
               fprintf(stderr, "%.*s\r", len, (char *)pdata);
            } else {
               // A small header
               Printf(" ");
               Printf("| Message from server:");
               Printf("| %.*s", len, (char *)pdata);
            }
         }
         break;
      case kXPD_errmsg:
         //
         // Error condition with message
         Printf("\n\n");
         Printf("| Error condition occured: message from server:");
         Printf("|    %.*s", len, (char *)pdata);
         Printf("\n");
         // Handle error
         if (fHandler)
            fHandler->HandleError();
         else
            Error("ProcessUnsolicitedMsg","handler undefined");
         break;
      case kXPD_msgsid:
         //
         // Data message
         { R__LOCKGUARD(fAMtx);

            // The next 4 bytes contain the sessiond id
            kXR_int32 cid = 0;
            memcpy(&cid, pdata, sizeof(kXR_int32));
            cid = net2host(cid);

            if (gDebug > 1)
               Info("ProcessUnsolicitedMsg","found cid: %d", cid);

            // Update pointer to data
            pdata = (void *)((char *)pdata + sizeof(kXR_int32));
            len -= sizeof(kXR_int32);

            // Get a spare buffer
            TXSockBuf *b = PopUpSpare(len);
            if (!b) {
               Error("ProcessUnsolicitedMsg","could allocate spare buffer");
               return rc;
            }
            memcpy(b->fBuf, pdata, len);
            b->fLen = len;

            // Set the sid
            b->fCid = cid;

            // Update counters
            fBytesRecv += len;

            // Produce the message
            fAQue.push_back(b);

            // Post the global pipe
            fgPipe.Post(this);

            // Signal it and release the mutex
            if (gDebug > 2)
               Info("ProcessUnsolicitedMsg","%p: cid: %d, posting semaphore: %p (%d bytes)",
                    this, cid, &fASem, len);
            fASem.Post();
         }

         break;
      case kXPD_wrkmortem:
         //
         // A worker died
         {  TString what = TString::Format("%.*s", len, (char *)pdata);
            if (what.BeginsWith("idle-timeout")) {
               // Notify the idle timeout
               PostMsg(kPROOF_FATAL, kPROOF_WorkerIdleTO);
            } else {
               Printf(" ");
               Printf("| %s", what.Data());
               // Handle error
               if (fHandler)
                  fHandler->HandleError();
               else
                  Error("ProcessUnsolicitedMsg","handler undefined");
            }
         }
         break;

      case kXPD_touch:
         //
         // Request for remote touch: post a message to do that
         PostMsg(kPROOF_TOUCH);
         break;
      case kXPD_resume:
         //
         // process the next query (in the TXProofServ)
         PostMsg(kPROOF_STARTPROCESS);
         break;
      case kXPD_clusterinfo:
         //
         // Broadcast cluster information
         {
            kXR_int32 nsess = -1, nacti = -1, neffs = -1;
            if (len > 0) {
               // Total sessions
               memcpy(&nsess, pdata, sizeof(kXR_int32));
               nsess = net2host(nsess);
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
               // Active sessions
               memcpy(&nacti, pdata, sizeof(kXR_int32));
               nacti = net2host(nacti);
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
               // Effective sessions
               memcpy(&neffs, pdata, sizeof(kXR_int32));
               neffs = net2host(neffs);
               pdata = (void *)((char *)pdata + sizeof(kXR_int32));
               len -= sizeof(kXR_int32);
            }
            if (gDebug > 1)
               Info("ProcessUnsolicitedMsg","kXPD_clusterinfo: # sessions: %d,"
                    " # active: %d, # effective: %f", nsess, nacti, neffs/1000.);
            // Handle this input in this thread to avoid queuing on the
            // main thread
            XHandleIn_t hin = {acod, nsess, nacti, neffs};
            if (fHandler)
               fHandler->HandleInput((const void *)&hin);
            else
               Error("ProcessUnsolicitedMsg","handler undefined");
         }
         break;
     default:
         Error("ProcessUnsolicitedMsg","%p: unknown action code: %d received from '%s' - disabling",
                                       this, acod, GetTitle());
         PostMsg(kPROOF_STOP);
         break;
   }

   // We are done
   return rc;
}

//_______________________________________________________________________
void TXSocket::PostMsg(Int_t type, const char *msg)
{
   // Post a message of type 'type' into the read messages queue.
   // If 'msg' is defined it is also added as TString.
   // This is used, for example, with kPROOF_FATAL to force the main thread
   // to mark this socket as bad, avoiding race condition when a worker
   // dies while in processing state.

   // Create the message
   TMessage m(type);

   // Add the string if any
   if (msg && strlen(msg) > 0)
      m << TString(msg);

   // Write length in first word of buffer
   m.SetLength();

   // Get pointer to the message buffer
   char *mbuf = m.Buffer();
   Int_t mlen = m.Length();
   if (m.CompBuffer()) {
      mbuf = m.CompBuffer();
      mlen = m.CompLength();
   }

   //
   // Data message
   R__LOCKGUARD(fAMtx);

   // Get a spare buffer
   TXSockBuf *b = PopUpSpare(mlen);
   if (!b) {
      Error("PostMsg", "could allocate spare buffer");
      return;
   }

   // Fill the pipe buffer
   memcpy(b->fBuf, mbuf, mlen);
   b->fLen = mlen;

   // Update counters
   fBytesRecv += mlen;

   // Produce the message
   fAQue.push_back(b);

   // Post the global pipe
   fgPipe.Post(this);

   // Signal it and release the mutex
   if (gDebug > 0)
      Info("PostMsg", "%p: posting type %d to semaphore: %p (%d bytes)",
                          this, type, &fASem, mlen);
   fASem.Post();

   // Done
   return;
}

//____________________________________________________________________________
Bool_t TXSocket::IsServProofd()
{
   // Return kTRUE if the remote server is a 'proofd'

   if (fConn && (fConn->GetServType() == XrdProofConn::kSTProofd))
      return kTRUE;

   // Failure
   return kFALSE;
}

//_____________________________________________________________________________
Int_t TXSocket::GetInterrupt(Bool_t &forward)
{
   // Get latest interrupt level and reset it; if the interrupt has to be
   // propagated to lower stages forward will be kTRUE after the call

   if (gDebug > 2)
      Info("GetInterrupt","%p: waiting to lock mutex %p", this, fIMtx);

   R__LOCKGUARD(fIMtx);

   // Reset values
   Int_t ilev = -1;
   forward = kFALSE;

   // Check if filled
   if (fILev == -1)
      Error("GetInterrupt", "value is unset (%d) - protocol error",fILev);

   // Fill output
   ilev = fILev;
   forward = fIForward;

   // Reset values (we process it only once)
   fILev = -1;
   fIForward = kFALSE;

   // Return what we got
   return ilev;
}

//_____________________________________________________________________________
Int_t TXSocket::Flush()
{
   // Flush the asynchronous queue.
   // Typically called when a kHardInterrupt is received.
   // Returns number of bytes in flushed buffers.

   Int_t nf = 0;
   list<TXSockBuf *> splist;
   list<TXSockBuf *>::iterator i;

   {  R__LOCKGUARD(fAMtx);

      // Must have something to flush
      if (fAQue.size() > 0) {

         // Save size for later semaphore cleanup
         Int_t sz = fAQue.size();
         // get the highest interrupt level
         for (i = fAQue.begin(); i != fAQue.end();) {
            if (*i) {
               splist.push_back(*i);
               nf += (*i)->fLen;
               i = fAQue.erase(i);
            }
         }

         // Reset the asynchronous queue
         while (sz--) {
            if (fASem.TryWait() == 1)
               Printf("Warning in TXSocket::Flush: semaphore counter already 0 (sz: %d)", sz);
         }
         fAQue.clear();
      }
   }

   // Move spares to the spare queue
   {  R__LOCKGUARD(&fgSMtx);
      if (splist.size() > 0) {
         for (i = splist.begin(); i != splist.end();) {
            fgSQue.push_back(*i);
            i = splist.erase(i);
         }
      }
   }
   
   // We are done
   return nf;
}

//_____________________________________________________________________________
Bool_t TXSocket::Create(Bool_t attach)
{
   // This method sends a request for creation of (or attachment to) a remote
   // server application.

   // Make sure we are connected
   if (!IsValid()) {
      if (gDebug > 0)
         Info("Create","not connected: nothing to do");
      return kFALSE;
   }

   Int_t retriesleft = gEnv->GetValue("XProof.CreationRetries", 4);

   while (retriesleft--) {

      XPClientRequest reqhdr;

      // We fill the header struct containing the request for login
      memset( &reqhdr, 0, sizeof(reqhdr));
      fConn->SetSID(reqhdr.header.streamid);

      // This will be a kXP_attach or kXP_create request
      if (fMode == 'A' || attach) {
         reqhdr.header.requestid = kXP_attach;
         reqhdr.proof.sid = fSessionID;
      } else {
         reqhdr.header.requestid = kXP_create;
      }

      // Send log level
      reqhdr.proof.int1 = fLogLevel;

      // Send also the chosen alias
      const void *buf = (const void *)(fBuffer.Data());
      reqhdr.header.dlen = fBuffer.Length();
      if (gDebug >= 2)
         Info("Create", "sending %d bytes to server", reqhdr.header.dlen);

      // We call SendReq, the function devoted to sending commands.
      if (gDebug > 1)
         Info("Create", "creating session of server %s", fUrl.Data());

      // server response header
      char *answData = 0;
      XrdClientMessage *xrsp = fConn->SendReq(&reqhdr, buf,
                                              &answData, "TXSocket::Create", 0);
      struct ServerResponseBody_Protocol *srvresp = (struct ServerResponseBody_Protocol *)answData;

      // If any, the URL the data pool entry point will be stored here
      fBuffer = "";
      if (xrsp) {

         //
         // Pointer to data
         void *pdata = (void *)(xrsp->GetData());
         Int_t len = xrsp->DataLen();

         if (len >= (Int_t)sizeof(kXR_int32)) {
            // The first 4 bytes contain the session ID
            kXR_int32 psid = 0;
            memcpy(&psid, pdata, sizeof(kXR_int32));
            fSessionID = net2host(psid);
            pdata = (void *)((char *)pdata + sizeof(kXR_int32));
            len -= sizeof(kXR_int32);
         } else {
            Error("Create","session ID is undefined!");
            fSessionID = -1;
            if (srvresp) free(srvresp);
            return kFALSE;
         }

         if (len >= (Int_t)sizeof(kXR_int16)) {
            // The second 2 bytes contain the remote PROOF protocol version
            kXR_int16 dver = 0;
            memcpy(&dver, pdata, sizeof(kXR_int16));
            fRemoteProtocol = net2host(dver);
            pdata = (void *)((char *)pdata + sizeof(kXR_int16));
            len -= sizeof(kXR_int16);
         } else {
            Warning("Create","protocol version of the remote PROOF undefined!");
         }

         if (fRemoteProtocol == 0) {
            // We are dealing with an older server: the PROOF protocol is on 4 bytes
            len += sizeof(kXR_int16);
            kXR_int32 dver = 0;
            memcpy(&dver, pdata, sizeof(kXR_int32));
            fRemoteProtocol = net2host(dver);
            pdata = (void *)((char *)pdata + sizeof(kXR_int32));
            len -= sizeof(kXR_int32);
         } else {
            if (len >= (Int_t)sizeof(kXR_int16)) {
               // The third 2 bytes contain the remote XrdProofdProtocol version
               kXR_int16 dver = 0;
               memcpy(&dver, pdata, sizeof(kXR_int16));
               fXrdProofdVersion = net2host(dver);
               pdata = (void *)((char *)pdata + sizeof(kXR_int16));
               len -= sizeof(kXR_int16);
            } else {
               Warning("Create","version of the remote XrdProofdProtocol undefined!");
            }
         }

         if (len > 0) {
            // From top masters, the url of the data pool
            char *url = new char[len+1];
            memcpy(url, pdata, len);
            url[len] = 0;
            fBuffer = url;
            delete[] url;
         }

         // Cleanup
         SafeDelete(xrsp);
         if (srvresp) free(srvresp);

         // Notify
         return kTRUE;
      } else {
         // Extract log file path, if any
         Ssiz_t ilog = kNPOS;
         if (retriesleft <= 0 && fConn->GetLastErr()) {
            fBuffer = fConn->GetLastErr();
            if ((ilog = fBuffer.Index("|log:")) != kNPOS) fBuffer.Remove(0, ilog);
         }
         // If not free resources now, just give up
         if (fConn->GetOpenError() == kXP_TooManySess) {
            // Avoid to contact the server any more
            fSessionID = -1;
            if (srvresp) free(srvresp);
            return kFALSE;
         } else {
            // Print error msg, if any
            if ((retriesleft <= 0 || gDebug > 0) && fConn->GetLastErr()) {
               TString emsg(fConn->GetLastErr());
               if ((ilog = emsg.Index("|log:")) != kNPOS) emsg.Remove(ilog);
               Printf("%s: %s", fHost.Data(), emsg.Data());
            }
         }
      }

      if (gDebug > 0)
         Info("Create", "creation/attachment attempt failed: %d attempts left", retriesleft);
      if (retriesleft <= 0)
         Error("Create", "%d creation/attachment attempts failed: no attempts left",
                         gEnv->GetValue("XProof.CreationRetries", 4));

      if (srvresp) free(srvresp);
   } // Creation retries
   
   // The session is invalid: reset the sessionID to invalid state (it was our protocol
   // number during creation
   fSessionID = -1;

   // Notify failure
   Error("Create:",
         "problems creating or attaching to a remote server (%s)",
         ((fConn->fLastErrMsg.length() > 0) ? fConn->fLastErrMsg.c_str() : "-"));
   return kFALSE;
}

//______________________________________________________________________________
Int_t TXSocket::SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt)
{
   // Send a raw buffer of specified length.
   // Use opt = kDontBlock to ask xproofd to push the message into the proofsrv.
   // (by default is appended to a queue waiting for a request from proofsrv).
   // Returns the number of bytes sent or -1 in case of error.

   TSystem::ResetErrno();

   // Options and request ID
   fSendOpt = (opt == kDontBlock) ? (kXPD_async | fSendOpt)
                                  : (~kXPD_async & fSendOpt) ;

   // Prepare request
   XPClientRequest Request;
   memset( &Request, 0, sizeof(Request) );
   fConn->SetSID(Request.header.streamid);
   Request.sendrcv.requestid = kXP_sendmsg;
   Request.sendrcv.sid = fSessionID;
   Request.sendrcv.opt = fSendOpt;
   Request.sendrcv.cid = GetClientID();
   Request.sendrcv.dlen = length;
   if (gDebug >= 2)
      Info("SendRaw", "sending %d bytes to server", Request.sendrcv.dlen);

   // Send request
   XrdClientMessage *xrsp = fConn->SendReq(&Request, buffer, 0, "SendRaw");

   if (xrsp) {
      // Prepare return info
      Int_t nsent = length;

      // Update counters
      fBytesSent += length;

      // Cleanup
      SafeDelete(xrsp);

      // Success: update usage timestamp
      Touch();

      // ok
      return nsent;
   } else {
      // Print error message, if any
      if (fConn->GetLastErr())
         Printf("%s: %s", fHost.Data(), fConn->GetLastErr());
      else
         Printf("%s: error occured but no message from server", fHost.Data());
   }

   // Failure notification (avoid using the handler: we may be exiting)
   Error("SendRaw", "%s: problems sending %d bytes to server",
                    fHost.Data(), length);
   return -1;
}

//______________________________________________________________________________
Bool_t TXSocket::Ping(const char *ord)
{
   // Ping functionality: contact the server to check its vitality.
   // If external, the server waits for a reply from the server
   // Returns kTRUE if OK or kFALSE in case of error.

   TSystem::ResetErrno();

   if (gDebug > 0)
      Info("Ping","%p: %s: sid: %d", this, ord ? ord : "int", fSessionID);

   // Make sure we are connected
   if (!IsValid()) {
      Error("Ping","not connected: nothing to do");
      return kFALSE;
   }

   // Options
   kXR_int32 options = (fMode == 'i') ? kXPD_internal : 0;

   // Prepare request
   XPClientRequest Request;
   memset( &Request, 0, sizeof(Request) );
   fConn->SetSID(Request.header.streamid);
   Request.sendrcv.requestid = kXP_ping;
   Request.sendrcv.sid = fSessionID;
   Request.sendrcv.opt = options;
   Request.sendrcv.dlen = 0;

   // Send request
   Bool_t res = kFALSE;
   if (fMode != 'i') {
      char *pans = 0;
      XrdClientMessage *xrsp =
         fConn->SendReq(&Request, (const void *)0, &pans, "Ping");
      kXR_int32 *pres = (kXR_int32 *) pans;

      // Get the result
      if (xrsp && xrsp->HeaderStatus() == kXR_ok) {
         *pres = net2host(*pres);
         res = (*pres == 1) ? kTRUE : kFALSE;
         // Success: update usage timestamp
         Touch();
      } else {
         // Print error msg, if any
         if (fConn->GetLastErr())
            Printf("%s: %s", fHost.Data(), fConn->GetLastErr());
      }

      // Cleanup
      SafeDelete(xrsp);
      if (pans) free(pans);

   } else {
      if (XPD::clientMarshall(&Request) == 0) {
         XReqErrorType e = fConn->LowWrite(&Request, 0, 0);
         res = (e == kOK) ? kTRUE : kFALSE;
      } else {
         Error("Ping", "%p: int: problems marshalling request", this);
      }
   }

   // Failure notification (avoid using the handler: we may be exiting)
   if (!res) {
      Error("Ping", "%p: %s: problems sending ping to server", this, ord ? ord : "int");
   } else if (gDebug > 0) {
      Info("Ping","%p: %s: sid: %d OK", this, ord ? ord : "int", fSessionID);
   }

   return res;
}

//______________________________________________________________________________
void TXSocket::RemoteTouch()
{
   // Remote touch functionality: contact the server to proof our vitality.
   // No reply from server is expected.

   TSystem::ResetErrno();

   if (gDebug > 0)
      Info("RemoteTouch","%p: sending touch request to %s", this, GetName());

   // Make sure we are connected
   if (!IsValid()) {
      Error("RemoteTouch","not connected: nothing to do");
      return;
   }

   // Prepare request
   XPClientRequest Request;
   memset( &Request, 0, sizeof(Request) );
   fConn->SetSID(Request.header.streamid);
   Request.sendrcv.requestid = kXP_touch;
   Request.sendrcv.sid = fSessionID;
   Request.sendrcv.opt = 0;
   Request.sendrcv.dlen = 0;

   // We need the right order
   if (XPD::clientMarshall(&Request) != 0) {
      Error("Touch", "%p: problems marshalling request ", this);
      return;
   }
   if (fConn->LowWrite(&Request, 0, 0) != kOK)
      Error("Touch", "%p: problems sending touch request to server", this);

   // Done
   return;
}

//______________________________________________________________________________
void TXSocket::CtrlC()
{
   // Interrupt the remote protocol instance. Used to propagate Ctrl-C.
   // No reply from server is expected.

   TSystem::ResetErrno();

   if (gDebug > 0)
      Info("CtrlC","%p: sending ctrl-c request to %s", this, GetName());

   // Make sure we are connected
   if (!IsValid()) {
      Error("CtrlC","not connected: nothing to do");
      return;
   }

   // Prepare request
   XPClientRequest Request;
   memset( &Request, 0, sizeof(Request) );
   fConn->SetSID(Request.header.streamid);
   Request.proof.requestid = kXP_ctrlc;
   Request.proof.sid = 0;
   Request.proof.dlen = 0;

   // We need the right order
   if (XPD::clientMarshall(&Request) != 0) {
      Error("CtrlC", "%p: problems marshalling request ", this);
      return;
   }
   if (fConn->LowWrite(&Request, 0, 0) != kOK)
      Error("CtrlC", "%p: problems sending ctrl-c request to server", this);

   // Done
   return;
}

//______________________________________________________________________________
Int_t TXSocket::PickUpReady()
{
   // Wait and pick-up next buffer from the asynchronous queue

   fBufCur = 0;
   fByteLeft = 0;
   fByteCur = 0;
   if (gDebug > 2)
      Info("PickUpReady", "%p: %s: going to sleep", this, GetTitle());

   // User can choose whether to wait forever or for a fixed amount of time
   if (!fDontTimeout) {
      static Int_t timeout = gEnv->GetValue("XProof.ReadTimeout", 300) * 1000;
      static Int_t dt = 2000;
      Int_t to = timeout;
      SetInterrupt(kFALSE);
      while (to && !IsInterrupt()) {
         SetAWait(kTRUE);
         if (fASem.Wait(dt) != 0) {
            to -= dt;
            if (to <= 0) {
               Error("PickUpReady","error waiting at semaphore");
               return -1;
            } else {
               if (gDebug > 0)
                  Info("PickUpReady", "%p: %s: got timeout: retring (%d secs)",
                                      this, GetTitle(), to/1000);
            }
         } else
            break;
         SetAWait(kFALSE);
      }
      // We wait forever
      if (IsInterrupt()) {
         if (gDebug > 2)
            Info("PickUpReady","interrupted");
         SetInterrupt(kFALSE);
         SetAWait(kFALSE);
         return -1;
      }
   } else {
      // We wait forever
      SetAWait(kTRUE);
      if (fASem.Wait() != 0) {
         Error("PickUpReady","error waiting at semaphore");
         SetAWait(kFALSE);
         return -1;
      }
      SetAWait(kFALSE);
   }
   if (gDebug > 2)
      Info("PickUpReady", "%p: %s: waken up", this, GetTitle());

   R__LOCKGUARD(fAMtx);

   // Get message, if any
   if (fAQue.size() <= 0) {
      Error("PickUpReady","queue is empty - protocol error ?");
      return -1;
   }
   if (!(fBufCur = fAQue.front())) {
      Error("PickUpReady","got invalid buffer - protocol error ?");
      return -1;
   }
   // Remove message from the queue
   fAQue.pop_front();

   // Set number of available bytes
   fByteLeft = fBufCur->fLen;

   if (gDebug > 2)
      Info("PickUpReady", "%p: %s: got message (%d bytes)",
                          this, GetTitle(), (Int_t)(fBufCur ? fBufCur->fLen : 0));

   // Update counters
   fBytesRecv += fBufCur->fLen;

   // Set session ID
   if (fBufCur->fCid > -1 && fBufCur->fCid != GetClientID())
      SetClientID(fBufCur->fCid);

   // Clean entry in the underlying pipe
   fgPipe.Clean(this);

   // We are done
   return 0;
}

//______________________________________________________________________________
TXSockBuf *TXSocket::PopUpSpare(Int_t size)
{
   // Pop-up a buffer of at least size bytes from the spare list
   // If none is found either one is reallocated or a new one
   // created
   TXSockBuf *buf = 0;
   static Int_t nBuf = 0;


   R__LOCKGUARD(&fgSMtx);


   Int_t maxsz = 0;
   if (fgSQue.size() > 0) {
      list<TXSockBuf *>::iterator i;
      for (i = fgSQue.begin(); i != fgSQue.end(); i++) {
         maxsz = ((*i)->fSiz > maxsz) ? (*i)->fSiz : maxsz;
         if ((*i) && (*i)->fSiz >= size) {
            buf = *i;
            if (gDebug > 2)
               Info("PopUpSpare","asked: %d, spare: %d/%d, REUSE buf %p, sz: %d",
                                 size, (int) fgSQue.size(), nBuf, buf, buf->fSiz);
            // Drop from this list
            fgSQue.erase(i);
            return buf;
         }
      }
      // All buffers are too small: enlarge the first one
      buf = fgSQue.front();
      buf->Resize(size);
      if (gDebug > 2)
         Info("PopUpSpare","asked: %d, spare: %d/%d, maxsz: %d, RESIZE buf %p, sz: %d",
                           size, (int) fgSQue.size(), nBuf, maxsz, buf, buf->fSiz);
      // Drop from this list
      fgSQue.pop_front();
      return buf;
   }

   // Create a new buffer
   buf = new TXSockBuf((char *)malloc(size), size);
   nBuf++;

   if (gDebug > 2)
      Info("PopUpSpare","asked: %d, spare: %d/%d, maxsz: %d, NEW buf %p, sz: %d",
                        size, (int) fgSQue.size(), nBuf, maxsz, buf, buf->fSiz);

   // We are done
   return buf;
}

//______________________________________________________________________________
void TXSocket::PushBackSpare()
{
   // Release read buffer giving back to the spare list

   R__LOCKGUARD(&fgSMtx);

   if (gDebug > 2)
      Info("PushBackSpare","release buf %p, sz: %d (BuffMem: %lld)",
                           fBufCur, fBufCur->fSiz, TXSockBuf::BuffMem());

   if (TXSockBuf::BuffMem() < TXSockBuf::GetMemMax()) {
      fgSQue.push_back(fBufCur);
   } else {
      delete fBufCur;
   }
   fBufCur = 0;
   fByteCur = 0;
   fByteLeft = 0;
}

//______________________________________________________________________________
Int_t TXSocket::RecvRaw(void *buffer, Int_t length, ESendRecvOptions)
{
   // Receive a raw buffer of specified length bytes.

   // Inputs must make sense
   if (!buffer || (length <= 0))
      return -1;

   // Wait and pick-up a read buffer if we do not have one
   if (!fBufCur && (PickUpReady() != 0))
      return -1;

   // Use it
   if (fByteLeft >= length) {
      memcpy(buffer, fBufCur->fBuf + fByteCur, length);
      fByteCur += length;
      if ((fByteLeft -= length) <= 0)
         // All used: give back
         PushBackSpare();
      // Success: update usage timestamp
      Touch();
      return length;
   } else {
      // Copy the first part
      memcpy(buffer, fBufCur->fBuf + fByteCur, fByteLeft);
      Int_t at = fByteLeft;
      Int_t tobecopied = length - fByteLeft;
      PushBackSpare();
      while (tobecopied > 0) {
         // Pick-up next buffer (it may wait inside)
         if (PickUpReady() != 0)
            return -1;
         // Copy the fresh meat
         Int_t ncpy = (fByteLeft > tobecopied) ? tobecopied : fByteLeft;
         memcpy((void *)((Char_t *)buffer+at), fBufCur->fBuf, ncpy);
         fByteCur = ncpy;
         if ((fByteLeft -= ncpy) <= 0)
            // All used: give back
            PushBackSpare();
         // Recalculate
         tobecopied -= ncpy;
         at += ncpy;
      }
   }

   // Update counters
   fBytesRecv  += length;
   fgBytesRecv += length;

   // Success: update usage timestamp
   Touch();

   return length;
}

//______________________________________________________________________________
Int_t TXSocket::SendInterrupt(Int_t type)
{
   // Send urgent message (interrupt) to remote server
   // Returns 0 or -1 in case of error.

   TSystem::ResetErrno();

   // Prepare request
   XPClientRequest Request;
   memset(&Request, 0, sizeof(Request) );
   fConn->SetSID(Request.header.streamid);
   if (type == (Int_t) TProof::kShutdownInterrupt)
      Request.interrupt.requestid = kXP_destroy;
   else
      Request.interrupt.requestid = kXP_interrupt;
   Request.interrupt.sid = fSessionID;
   Request.interrupt.type = type;    // type of interrupt (see TProof::EUrgent)
   Request.interrupt.dlen = 0;

   // Send request
   XrdClientMessage *xrsp =
      fConn->SendReq(&Request, (const void *)0, 0, "SendInterrupt");
   if (xrsp) {
      // Success: update usage timestamp
      Touch();
      // Cleanup
      SafeDelete(xrsp);
      // ok
      return 0;
   } else {
      // Print error msg, if any
      if (fConn->GetLastErr())
         Printf("%s: %s", fHost.Data(), fConn->GetLastErr());
   }

   // Failure notification (avoid using the handler: we may be exiting)
   Error("SendInterrupt", "problems sending interrupt to server");
   return -1;
}

//______________________________________________________________________________
Int_t TXSocket::Send(const TMessage &mess)
{
   // Send a TMessage object. Returns the number of bytes in the TMessage
   // that were sent and -1 in case of error.

   TSystem::ResetErrno();

   if (mess.IsReading()) {
      Error("Send", "cannot send a message used for reading");
      return -1;
   }

   // send streamer infos in case schema evolution is enabled in the TMessage
   SendStreamerInfos(mess);

   // send the process id's so TRefs work
   SendProcessIDs(mess);

   mess.SetLength();   //write length in first word of buffer

   if (GetCompressionLevel() > 0 && mess.GetCompressionLevel() == 0)
      const_cast<TMessage&>(mess).SetCompressionSettings(fCompress);

   if (mess.GetCompressionLevel() > 0)
      const_cast<TMessage&>(mess).Compress();

   char *mbuf = mess.Buffer();
   Int_t mlen = mess.Length();
   if (mess.CompBuffer()) {
      mbuf = mess.CompBuffer();
      mlen = mess.CompLength();
   }

   // Parse message type to choose sending options
   kXR_int32 fSendOptDefault = fSendOpt;
   switch (mess.What()) {
      case kPROOF_PROCESS:
         fSendOpt |= kXPD_process;
         break;
      case kPROOF_PROGRESS:
      case kPROOF_FEEDBACK:
         fSendOpt |= kXPD_fb_prog;
         break;
      case kPROOF_QUERYSUBMITTED:
         fSendOpt |= kXPD_querynum;
         fSendOpt |= kXPD_fb_prog;
         break;
      case kPROOF_STARTPROCESS:
         fSendOpt |= kXPD_startprocess;
         fSendOpt |= kXPD_fb_prog;
         break;
      case kPROOF_STOPPROCESS:
         fSendOpt |= kXPD_fb_prog;
         break;
      case kPROOF_SETIDLE:
         fSendOpt |= kXPD_setidle;
         fSendOpt |= kXPD_fb_prog;
         break;
      case kPROOF_LOGFILE:
      case kPROOF_LOGDONE:
         if (GetClientIDSize() <= 1)
            fSendOpt |= kXPD_logmsg;
         break;
      default:
         break;
   }

   if (gDebug > 2)
      Info("Send", "sending type %d (%d bytes) to '%s'", mess.What(), mlen, GetTitle());

   Int_t nsent = SendRaw(mbuf, mlen);
   fSendOpt = fSendOptDefault;

   if (nsent <= 0)
      return nsent;

   fBytesSent  += nsent;
   fgBytesSent += nsent;

   return nsent - sizeof(UInt_t);  //length - length header
}

//______________________________________________________________________________
Int_t TXSocket::Recv(TMessage *&mess)
{
   // Receive a TMessage object. The user must delete the TMessage object.
   // Returns length of message in bytes (can be 0 if other side of connection
   // is closed) or -1 in case of error or -5 if pipe broken (connection invalid).
   // In those case mess == 0.

   TSystem::ResetErrno();

   if (!IsValid()) {
      mess = 0;
      return -5;
   }

oncemore:
   Int_t  n;
   UInt_t len;
   if ((n = RecvRaw(&len, sizeof(UInt_t))) <= 0) {
      mess = 0;
      return n;
   }
   len = net2host(len);  //from network to host byte order

   char *buf = new char[len+sizeof(UInt_t)];
   if ((n = RecvRaw(buf+sizeof(UInt_t), len)) <= 0) {
      delete [] buf;
      mess = 0;
      return n;
   }

   fBytesRecv  += n + sizeof(UInt_t);
   fgBytesRecv += n + sizeof(UInt_t);

   mess = new TMessage(buf, len+sizeof(UInt_t));

   // receive any streamer infos
   if (RecvStreamerInfos(mess))
      goto oncemore;

   // receive any process ids
   if (RecvProcessIDs(mess))
      goto oncemore;

   if (mess->What() & kMESS_ACK) {
      // Acknowledgement embedded: ignore ...
      mess->SetWhat(mess->What() & ~kMESS_ACK);
   }

   return n;
}

//______________________________________________________________________________
TObjString *TXSocket::SendCoordinator(Int_t kind, const char *msg, Int_t int2,
                                      Long64_t l64, Int_t int3, const char *)
{
   // Send message to intermediate coordinator.
   // If any output is due, this is returned as an obj string to be
   // deleted by the caller

   TObjString *sout = 0;

   // We fill the header struct containing the request
   XPClientRequest reqhdr;
   const void *buf = 0;
   char *bout = 0;
   char **vout = 0;
   memset(&reqhdr, 0, sizeof(reqhdr));
   fConn->SetSID(reqhdr.header.streamid);
   reqhdr.header.requestid = kXP_admin;
   reqhdr.proof.int1 = kind;
   reqhdr.proof.int2 = int2;
   switch (kind) {
      case kQueryMssUrl:
      case kQueryROOTVersions:
      case kQuerySessions:
      case kQueryWorkers:
         reqhdr.proof.sid = 0;
         reqhdr.header.dlen = 0;
         vout = (char **)&bout;
         break;
      case kCleanupSessions:
         reqhdr.proof.int2 = (int2 == 1) ? (kXR_int32) kXPD_AnyServer
                                         : (kXR_int32) kXPD_TopMaster;
         reqhdr.proof.int3 = int2;
         reqhdr.proof.sid = fSessionID;
         reqhdr.header.dlen = (msg) ? strlen(msg) : 0;
         buf = (msg) ? (const void *)msg : buf;
         break;
      case kCpFile:
      case kGetFile:
      case kPutFile:
      case kExec:
         reqhdr.proof.sid = fSessionID;
         reqhdr.header.dlen = (msg) ? strlen(msg) : 0;
         buf = (msg) ? (const void *)msg : buf;
         vout = (char **)&bout;
         break;
      case kQueryLogPaths:
         vout = (char **)&bout;
         reqhdr.proof.int3 = int3;
      case kReleaseWorker:
      case kSendMsgToUser:
      case kGroupProperties:
      case kSessionTag:
      case kSessionAlias:
         reqhdr.proof.sid = fSessionID;
         reqhdr.header.dlen = (msg) ? strlen(msg) : 0;
         buf = (msg) ? (const void *)msg : buf;
         break;
      case kROOTVersion:
         reqhdr.header.dlen = (msg) ? strlen(msg) : 0;
         buf = (msg) ? (const void *)msg : buf;
         break;
      case kGetWorkers:
         reqhdr.proof.sid = fSessionID;
         reqhdr.header.dlen = (msg) ? strlen(msg) : 0;
         if (msg)
            buf = (const void *)msg;
         vout = (char **)&bout;
         break;
      case kReadBuffer:
         reqhdr.header.requestid = kXP_readbuf;
         reqhdr.readbuf.ofs = l64;
         reqhdr.readbuf.len = int2;
         if (int3 > 0 && fXrdProofdVersion < 1003) {
            Info("SendCoordinator", "kReadBuffer: old server (ver %d < 1003):"
                 " grep functionality not supported", fXrdProofdVersion);
            return sout;
         }
         reqhdr.readbuf.int1 = int3;
         if (!msg || strlen(msg) <= 0) {
            Info("SendCoordinator", "kReadBuffer: file path undefined");
            return sout;
         }
         reqhdr.header.dlen = strlen(msg);
         buf = (const void *)msg;
         vout = (char **)&bout;
         break;
      default:
         Info("SendCoordinator", "unknown message kind: %d", kind);
         return sout;
   }

   // server response header
   Bool_t noterr = (gDebug > 0) ? kTRUE : kFALSE;
   XrdClientMessage *xrsp =
      fConn->SendReq(&reqhdr, buf, vout, "TXSocket::SendCoordinator", noterr);

   // If positive answer
   if (xrsp) {
      // Check if we need to create an output string
      if (bout && (xrsp->DataLen() > 0))
         sout = new TObjString(TString(bout,xrsp->DataLen()));
      if (bout)
         free(bout);
      // Success: update usage timestamp
      Touch();
      SafeDelete(xrsp);
   } else {
      // Print error msg, if any
      if (fConn->GetLastErr())
         Printf("%s: %s", fHost.Data(), fConn->GetLastErr());
   }

   // Failure notification (avoid using the handler: we may be exiting)
   return sout;
}

//______________________________________________________________________________
void TXSocket::SendUrgent(Int_t type, Int_t int1, Int_t int2)
{
   // Send urgent message to counterpart; 'type' specifies the type of
   // the message (see TXSocket::EUrgentMsgType), and 'int1', 'int2'
   // two containers for additional information.

   TSystem::ResetErrno();

   // Prepare request
   XPClientRequest Request;
   memset(&Request, 0, sizeof(Request) );
   fConn->SetSID(Request.header.streamid);
   Request.proof.requestid = kXP_urgent;
   Request.proof.sid = fSessionID;
   Request.proof.int1 = type;    // type of urgent msg (see TXSocket::EUrgentMsgType)
   Request.proof.int2 = int1;    // 4-byte container info 1
   Request.proof.int3 = int2;    // 4-byte container info 2
   Request.proof.dlen = 0;

   // Send request
   XrdClientMessage *xrsp =
      fConn->SendReq(&Request, (const void *)0, 0, "SendUrgent");
   if (xrsp) {
      // Success: update usage timestamp
      Touch();
      // Cleanup
      SafeDelete(xrsp);
   } else {
      // Print error msg, if any
      if (fConn->GetLastErr())
         Printf("%s: %s", fHost.Data(), fConn->GetLastErr());
   }

   // Done
   return;
}

//_____________________________________________________________________________
void TXSocket::InitEnvs()
{
   // Init environment variables for XrdClient

   // Set debug level
   Int_t deb = gEnv->GetValue("XProof.Debug", -1);
   EnvPutInt(NAME_DEBUG, deb);
   if (deb > 0) {
      XrdProofdTrace->What |= TRACE_REQ;
      if (deb > 1) {
         XrdProofdTrace->What |= TRACE_DBG;
         if (deb > 2)
            XrdProofdTrace->What |= TRACE_ALL;
      }
   }
   const char *cenv = 0;

   // List of domains where connection is allowed
   TString allowCO = gEnv->GetValue("XProof.ConnectDomainAllowRE", "");
   if (allowCO.Length() > 0)
      EnvPutString(NAME_CONNECTDOMAINALLOW_RE, allowCO.Data());

   // List of domains where connection is denied
   TString denyCO  = gEnv->GetValue("XProof.ConnectDomainDenyRE", "");
   if (denyCO.Length() > 0)
      EnvPutString(NAME_CONNECTDOMAINDENY_RE, denyCO.Data());

   // Max number of retries on first connect and related timeout
   XrdProofConn::SetRetryParam(-1, -1);
   Int_t maxRetries = gEnv->GetValue("XProof.FirstConnectMaxCnt",5);
   EnvPutInt(NAME_FIRSTCONNECTMAXCNT, maxRetries);
   Int_t connTO = gEnv->GetValue("XProof.ConnectTimeout", 2);
   EnvPutInt(NAME_CONNECTTIMEOUT, connTO);

   // Reconnect Wait
   Int_t recoTO = gEnv->GetValue("XProof.ReconnectWait",
                                  DFLT_RECONNECTWAIT);
   if (recoTO == DFLT_RECONNECTWAIT) {
      // Check also the old variable name
      recoTO = gEnv->GetValue("XProof.ReconnectTimeout",
                                  DFLT_RECONNECTWAIT);
   }
   EnvPutInt(NAME_RECONNECTWAIT, recoTO);

   // Request Timeout
   Int_t requTO = gEnv->GetValue("XProof.RequestTimeout", 150);
   EnvPutInt(NAME_REQUESTTIMEOUT, requTO);

   // No automatic proofd backward-compatibility
   EnvPutInt(NAME_KEEPSOCKOPENIFNOTXRD, 0);

   // Dynamic forwarding (SOCKS4)
   TString socks4Host = gEnv->GetValue("XNet.SOCKS4Host","");
   Int_t socks4Port = gEnv->GetValue("XNet.SOCKS4Port",-1);
   if (socks4Port > 0) {
      if (socks4Host.IsNull())
         // Default
         socks4Host = "127.0.0.1";
      EnvPutString(NAME_SOCKS4HOST, socks4Host.Data());
      EnvPutInt(NAME_SOCKS4PORT, socks4Port);
   }

   // For password-based authentication
   TString autolog = gEnv->GetValue("XSec.Pwd.AutoLogin","1");
   if (autolog.Length() > 0 &&
      (!(cenv = gSystem->Getenv("XrdSecPWDAUTOLOG")) || strlen(cenv) <= 0))
      gSystem->Setenv("XrdSecPWDAUTOLOG",autolog.Data());

   // For password-based authentication
   TString netrc;
   netrc.Form("%s/.rootnetrc",gSystem->HomeDirectory());
   gSystem->Setenv("XrdSecNETRC", netrc.Data());

   TString alogfile = gEnv->GetValue("XSec.Pwd.ALogFile","");
   if (alogfile.Length() > 0)
      gSystem->Setenv("XrdSecPWDALOGFILE",alogfile.Data());

   TString verisrv = gEnv->GetValue("XSec.Pwd.VerifySrv","1");
   if (verisrv.Length() > 0 &&
      (!(cenv = gSystem->Getenv("XrdSecPWDVERIFYSRV")) || strlen(cenv) <= 0))
      gSystem->Setenv("XrdSecPWDVERIFYSRV",verisrv.Data());

   TString srvpuk = gEnv->GetValue("XSec.Pwd.ServerPuk","");
   if (srvpuk.Length() > 0)
      gSystem->Setenv("XrdSecPWDSRVPUK",srvpuk.Data());

   // For GSI authentication
   TString cadir = gEnv->GetValue("XSec.GSI.CAdir","");
   if (cadir.Length() > 0)
      gSystem->Setenv("XrdSecGSICADIR",cadir.Data());

   TString crldir = gEnv->GetValue("XSec.GSI.CRLdir","");
   if (crldir.Length() > 0)
      gSystem->Setenv("XrdSecGSICRLDIR",crldir.Data());

   TString crlext = gEnv->GetValue("XSec.GSI.CRLextension","");
   if (crlext.Length() > 0)
      gSystem->Setenv("XrdSecGSICRLEXT",crlext.Data());

   TString ucert = gEnv->GetValue("XSec.GSI.UserCert","");
   if (ucert.Length() > 0)
      gSystem->Setenv("XrdSecGSIUSERCERT",ucert.Data());

   TString ukey = gEnv->GetValue("XSec.GSI.UserKey","");
   if (ukey.Length() > 0)
      gSystem->Setenv("XrdSecGSIUSERKEY",ukey.Data());

   TString upxy = gEnv->GetValue("XSec.GSI.UserProxy","");
   if (upxy.Length() > 0)
      gSystem->Setenv("XrdSecGSIUSERPROXY",upxy.Data());

   TString valid = gEnv->GetValue("XSec.GSI.ProxyValid","");
   if (valid.Length() > 0)
      gSystem->Setenv("XrdSecGSIPROXYVALID",valid.Data());

   TString deplen = gEnv->GetValue("XSec.GSI.ProxyForward","0");
   if (deplen.Length() > 0 &&
      (!(cenv = gSystem->Getenv("XrdSecGSIPROXYDEPLEN")) || strlen(cenv) <= 0))
      gSystem->Setenv("XrdSecGSIPROXYDEPLEN",deplen.Data());

   TString pxybits = gEnv->GetValue("XSec.GSI.ProxyKeyBits","");
   if (pxybits.Length() > 0)
      gSystem->Setenv("XrdSecGSIPROXYKEYBITS",pxybits.Data());

   TString crlcheck = gEnv->GetValue("XSec.GSI.CheckCRL","1");
   if (crlcheck.Length() > 0 &&
      (!(cenv = gSystem->Getenv("XrdSecGSICRLCHECK")) || strlen(cenv) <= 0))
      gSystem->Setenv("XrdSecGSICRLCHECK",crlcheck.Data());

   TString delegpxy = gEnv->GetValue("XSec.GSI.DelegProxy","0");
   if (delegpxy.Length() > 0 &&
      (!(cenv = gSystem->Getenv("XrdSecGSIDELEGPROXY")) || strlen(cenv) <= 0))
      gSystem->Setenv("XrdSecGSIDELEGPROXY",delegpxy.Data());

   TString signpxy = gEnv->GetValue("XSec.GSI.SignProxy","1");
   if (signpxy.Length() > 0 &&
      (!(cenv = gSystem->Getenv("XrdSecGSISIGNPROXY")) || strlen(cenv) <= 0))
      gSystem->Setenv("XrdSecGSISIGNPROXY",signpxy.Data());

   // Print the tag, if required (only once)
   if (gEnv->GetValue("XNet.PrintTAG",0) == 1)
      ::Info("TXSocket","(C) 2005 CERN TXSocket (XPROOF client) %s",
            gROOT->GetVersion());

   // Only once
   fgInitDone = kTRUE;
}

//______________________________________________________________________________
Int_t TXSocket::Reconnect()
{
   // Try reconnection after failure

   if (gDebug > 0) {
      Info("Reconnect", "%p (c:%p, v:%d): trying to reconnect to %s (logid: %d)",
                        this, fConn, (fConn ? fConn->IsValid() : 0),
                        fUrl.Data(), fConn->GetLogConnID());
   }

   Int_t tryreconnect = gEnv->GetValue("TXSocket.Reconnect", 1);
   if (tryreconnect == 0 || fXrdProofdVersion < 1005) {
      if (tryreconnect == 0)
         Info("Reconnect","%p: reconnection attempts explicitly disabled!", this);
      else
         Info("Reconnect","%p: server does not support reconnections (protocol: %d < 1005)",
                          this, fXrdProofdVersion);
      return -1;
   }

   if (fConn) {
      if (gDebug > 0)
         Info("Reconnect", "%p: locking phyconn: %p", this, fConn->fPhyConn);
      fConn->ReConnect();
      if (fConn->IsValid()) {
         // Create new proofserv if not client manager or administrator or internal mode
         if (fMode == 'm' || fMode == 's' || fMode == 'M' || fMode == 'A') {
            // We attach or create
            if (!Create(kTRUE)) {
               // Failure
               Error("TXSocket", "create or attach failed (%s)",
                     ((fConn->fLastErrMsg.length() > 0) ? fConn->fLastErrMsg.c_str() : "-"));
               Close();
               return -1;
            }
         }
      }
   }

   if (gDebug > 0) {
      if (fConn) {
         Info("Reconnect", "%p (c:%p): attempt %s (logid: %d)", this, fConn,
                           (fConn->IsValid() ? "succeeded!" : "failed"),
                           fConn->GetLogConnID() );
      } else {
         Info("Reconnect", "%p (c:0x0): attempt failed", this);
      }
   }

   // Done
   return ((fConn && fConn->IsValid()) ? 0 : -1);
}

//_____________________________________________________________________________
TXSockBuf::TXSockBuf(Char_t *bp, Int_t sz, Bool_t own)
{
   //constructor
   fBuf = fMem = bp;
   fSiz = fLen = sz;
   fOwn = own;
   fCid = -1;
   fgBuffMem += sz;
}

//_____________________________________________________________________________
TXSockBuf::~TXSockBuf()
{
   //destructor
   if (fOwn && fMem) {
      free(fMem);
      fgBuffMem -= fSiz;
   }
}

//_____________________________________________________________________________
void TXSockBuf::Resize(Int_t sz)
{
   //resize socket buffer
   if (sz > fSiz) {
      if ((fMem = (Char_t *)realloc(fMem, sz))) {
         fgBuffMem += (sz - fSiz);
         fBuf = fMem;
         fSiz = sz;
         fLen = 0;
      }
   }
}

//_____________________________________________________________________________
//
// TXSockBuf static methods
//

//_____________________________________________________________________________
Long64_t TXSockBuf::BuffMem()
{
   // Return the currently allocated memory

   return fgBuffMem;
}

//_____________________________________________________________________________
Long64_t TXSockBuf::GetMemMax()
{
   // Return the max allocated memory allowed

   return fgMemMax;
}

//_____________________________________________________________________________
void TXSockBuf::SetMemMax(Long64_t memmax)
{
   // Return the max allocated memory allowed

   fgMemMax = memmax > 0 ? memmax : fgMemMax;
}

//_____________________________________________________________________________
//
// TXSockPipe
//

//_____________________________________________________________________________
TXSockPipe::TXSockPipe(const char *loc) : fMutex(kTRUE), fLoc(loc)
{
   // Constructor

   // Create the pipe
   if (pipe(fPipe) != 0) {
      Printf("TXSockPipe: problem initializing pipe for socket inputs");
      fPipe[0] = -1;
      fPipe[1] = -1;
      return;
   }
}

//_____________________________________________________________________________
TXSockPipe::~TXSockPipe()
{
   // Destructor

   if (fPipe[0] >= 0) close(fPipe[0]);
   if (fPipe[1] >= 0) close(fPipe[1]);
}


//____________________________________________________________________________
Int_t TXSockPipe::Post(TSocket *s)
{
   // Write a byte to the global pipe to signal new availibility of
   // new messages

   if (!IsValid() || !s) return -1;

   // This must be an atomic action
   Int_t sz = 0;
   {  R__LOCKGUARD(&fMutex);
      // Add this one
      fReadySock.Add(s);

      // Only one char
      Char_t c = 1;
      if (write(fPipe[1],(const void *)&c, sizeof(Char_t)) < 1) {
         Printf("TXSockPipe::Post: %s: can't notify pipe", fLoc.Data());
         return -1;
      }
      if (gDebug > 2) sz = fReadySock.GetSize();
   }

   if (gDebug > 2)
      Printf("TXSockPipe::Post: %s: %p: pipe posted (pending %d) (descriptor: %d)",
                               fLoc.Data(), s, sz, fPipe[1]);
   // We are done
   return 0;
}

//____________________________________________________________________________
Int_t TXSockPipe::Clean(TSocket *s)
{
   // Read a byte to the global pipe to synchronize message pickup

   // Pipe must have been created
   if (!IsValid() || !s) return -1;

   // Only one char
   Int_t sz = 0;
   Char_t c = 0;
   { R__LOCKGUARD(&fMutex);
      if (read(fPipe[0],(void *)&c, sizeof(Char_t)) < 1) {
         Printf("TXSockPipe::Clean: %s: can't read from pipe", fLoc.Data());
         return -1;
      }
      // Remove this one
      fReadySock.Remove(s);

      if (gDebug > 2) sz = fReadySock.GetSize();
   }

   if (gDebug > 2)
      Printf("TXSockPipe::Clean: %s: %p: pipe cleaned (pending %d) (descriptor: %d)",
                               fLoc.Data(), s, sz, fPipe[0]);

   // We are done
   return 0;
}

//____________________________________________________________________________
Int_t TXSockPipe::Flush(TSocket *s)
{
   // Remove any reference to socket 's' from the global pipe and
   // ready-socket queue

   // Pipe must have been created
   if (!IsValid() || !s) return -1;

   TObject *o = 0;
   // This must be an atomic action
   {  R__LOCKGUARD(&fMutex);
      o = fReadySock.FindObject(s);

      while (o) {
         // Remove from the list
         fReadySock.Remove(s);
         o = fReadySock.FindObject(s);
         // Remove one notification from the pipe
         Char_t c = 0;
         if (read(fPipe[0],(void *)&c, sizeof(Char_t)) < 1)
            Printf("TXSockPipe::Flush: %s: can't read from pipe", fLoc.Data());
      }
   }
   // Flush also the socket
   ((TXSocket *)s)->Flush();

   // Notify
   if (gDebug > 0)
      Printf("TXSockPipe::Flush: %s: %p: pipe flushed", fLoc.Data(), s);

   // We are done
   return 0;
}

//______________________________________________________________________________
void TXSockPipe::DumpReadySock()
{
   // Dump content of the ready socket list

   R__LOCKGUARD(&fMutex);

   TString buf = Form("%d |", fReadySock.GetSize());
   TIter nxs(&fReadySock);
   TObject *o = 0;
   while ((o = nxs()))
      buf += Form(" %p",o);
   Printf("TXSockPipe::DumpReadySock: %s: list content: %s", fLoc.Data(), buf.Data());
}

//______________________________________________________________________________
TXSocket *TXSockPipe::GetLastReady()
{
   // Return last ready socket

   R__LOCKGUARD(&fMutex);

   return (TXSocket *) fReadySock.Last();
}
 TXSocket.cxx:1
 TXSocket.cxx:2
 TXSocket.cxx:3
 TXSocket.cxx:4
 TXSocket.cxx:5
 TXSocket.cxx:6
 TXSocket.cxx:7
 TXSocket.cxx:8
 TXSocket.cxx:9
 TXSocket.cxx:10
 TXSocket.cxx:11
 TXSocket.cxx:12
 TXSocket.cxx:13
 TXSocket.cxx:14
 TXSocket.cxx:15
 TXSocket.cxx:16
 TXSocket.cxx:17
 TXSocket.cxx:18
 TXSocket.cxx:19
 TXSocket.cxx:20
 TXSocket.cxx:21
 TXSocket.cxx:22
 TXSocket.cxx:23
 TXSocket.cxx:24
 TXSocket.cxx:25
 TXSocket.cxx:26
 TXSocket.cxx:27
 TXSocket.cxx:28
 TXSocket.cxx:29
 TXSocket.cxx:30
 TXSocket.cxx:31
 TXSocket.cxx:32
 TXSocket.cxx:33
 TXSocket.cxx:34
 TXSocket.cxx:35
 TXSocket.cxx:36
 TXSocket.cxx:37
 TXSocket.cxx:38
 TXSocket.cxx:39
 TXSocket.cxx:40
 TXSocket.cxx:41
 TXSocket.cxx:42
 TXSocket.cxx:43
 TXSocket.cxx:44
 TXSocket.cxx:45
 TXSocket.cxx:46
 TXSocket.cxx:47
 TXSocket.cxx:48
 TXSocket.cxx:49
 TXSocket.cxx:50
 TXSocket.cxx:51
 TXSocket.cxx:52
 TXSocket.cxx:53
 TXSocket.cxx:54
 TXSocket.cxx:55
 TXSocket.cxx:56
 TXSocket.cxx:57
 TXSocket.cxx:58
 TXSocket.cxx:59
 TXSocket.cxx:60
 TXSocket.cxx:61
 TXSocket.cxx:62
 TXSocket.cxx:63
 TXSocket.cxx:64
 TXSocket.cxx:65
 TXSocket.cxx:66
 TXSocket.cxx:67
 TXSocket.cxx:68
 TXSocket.cxx:69
 TXSocket.cxx:70
 TXSocket.cxx:71
 TXSocket.cxx:72
 TXSocket.cxx:73
 TXSocket.cxx:74
 TXSocket.cxx:75
 TXSocket.cxx:76
 TXSocket.cxx:77
 TXSocket.cxx:78
 TXSocket.cxx:79
 TXSocket.cxx:80
 TXSocket.cxx:81
 TXSocket.cxx:82
 TXSocket.cxx:83
 TXSocket.cxx:84
 TXSocket.cxx:85
 TXSocket.cxx:86
 TXSocket.cxx:87
 TXSocket.cxx:88
 TXSocket.cxx:89
 TXSocket.cxx:90
 TXSocket.cxx:91
 TXSocket.cxx:92
 TXSocket.cxx:93
 TXSocket.cxx:94
 TXSocket.cxx:95
 TXSocket.cxx:96
 TXSocket.cxx:97
 TXSocket.cxx:98
 TXSocket.cxx:99
 TXSocket.cxx:100
 TXSocket.cxx:101
 TXSocket.cxx:102
 TXSocket.cxx:103
 TXSocket.cxx:104
 TXSocket.cxx:105
 TXSocket.cxx:106
 TXSocket.cxx:107
 TXSocket.cxx:108
 TXSocket.cxx:109
 TXSocket.cxx:110
 TXSocket.cxx:111
 TXSocket.cxx:112
 TXSocket.cxx:113
 TXSocket.cxx:114
 TXSocket.cxx:115
 TXSocket.cxx:116
 TXSocket.cxx:117
 TXSocket.cxx:118
 TXSocket.cxx:119
 TXSocket.cxx:120
 TXSocket.cxx:121
 TXSocket.cxx:122
 TXSocket.cxx:123
 TXSocket.cxx:124
 TXSocket.cxx:125
 TXSocket.cxx:126
 TXSocket.cxx:127
 TXSocket.cxx:128
 TXSocket.cxx:129
 TXSocket.cxx:130
 TXSocket.cxx:131
 TXSocket.cxx:132
 TXSocket.cxx:133
 TXSocket.cxx:134
 TXSocket.cxx:135
 TXSocket.cxx:136
 TXSocket.cxx:137
 TXSocket.cxx:138
 TXSocket.cxx:139
 TXSocket.cxx:140
 TXSocket.cxx:141
 TXSocket.cxx:142
 TXSocket.cxx:143
 TXSocket.cxx:144
 TXSocket.cxx:145
 TXSocket.cxx:146
 TXSocket.cxx:147
 TXSocket.cxx:148
 TXSocket.cxx:149
 TXSocket.cxx:150
 TXSocket.cxx:151
 TXSocket.cxx:152
 TXSocket.cxx:153
 TXSocket.cxx:154
 TXSocket.cxx:155
 TXSocket.cxx:156
 TXSocket.cxx:157
 TXSocket.cxx:158
 TXSocket.cxx:159
 TXSocket.cxx:160
 TXSocket.cxx:161
 TXSocket.cxx:162
 TXSocket.cxx:163
 TXSocket.cxx:164
 TXSocket.cxx:165
 TXSocket.cxx:166
 TXSocket.cxx:167
 TXSocket.cxx:168
 TXSocket.cxx:169
 TXSocket.cxx:170
 TXSocket.cxx:171
 TXSocket.cxx:172
 TXSocket.cxx:173
 TXSocket.cxx:174
 TXSocket.cxx:175
 TXSocket.cxx:176
 TXSocket.cxx:177
 TXSocket.cxx:178
 TXSocket.cxx:179
 TXSocket.cxx:180
 TXSocket.cxx:181
 TXSocket.cxx:182
 TXSocket.cxx:183
 TXSocket.cxx:184
 TXSocket.cxx:185
 TXSocket.cxx:186
 TXSocket.cxx:187
 TXSocket.cxx:188
 TXSocket.cxx:189
 TXSocket.cxx:190
 TXSocket.cxx:191
 TXSocket.cxx:192
 TXSocket.cxx:193
 TXSocket.cxx:194
 TXSocket.cxx:195
 TXSocket.cxx:196
 TXSocket.cxx:197
 TXSocket.cxx:198
 TXSocket.cxx:199
 TXSocket.cxx:200
 TXSocket.cxx:201
 TXSocket.cxx:202
 TXSocket.cxx:203
 TXSocket.cxx:204
 TXSocket.cxx:205
 TXSocket.cxx:206
 TXSocket.cxx:207
 TXSocket.cxx:208
 TXSocket.cxx:209
 TXSocket.cxx:210
 TXSocket.cxx:211
 TXSocket.cxx:212
 TXSocket.cxx:213
 TXSocket.cxx:214
 TXSocket.cxx:215
 TXSocket.cxx:216
 TXSocket.cxx:217
 TXSocket.cxx:218
 TXSocket.cxx:219
 TXSocket.cxx:220
 TXSocket.cxx:221
 TXSocket.cxx:222
 TXSocket.cxx:223
 TXSocket.cxx:224
 TXSocket.cxx:225
 TXSocket.cxx:226
 TXSocket.cxx:227
 TXSocket.cxx:228
 TXSocket.cxx:229
 TXSocket.cxx:230
 TXSocket.cxx:231
 TXSocket.cxx:232
 TXSocket.cxx:233
 TXSocket.cxx:234
 TXSocket.cxx:235
 TXSocket.cxx:236
 TXSocket.cxx:237
 TXSocket.cxx:238
 TXSocket.cxx:239
 TXSocket.cxx:240
 TXSocket.cxx:241
 TXSocket.cxx:242
 TXSocket.cxx:243
 TXSocket.cxx:244
 TXSocket.cxx:245
 TXSocket.cxx:246
 TXSocket.cxx:247
 TXSocket.cxx:248
 TXSocket.cxx:249
 TXSocket.cxx:250
 TXSocket.cxx:251
 TXSocket.cxx:252
 TXSocket.cxx:253
 TXSocket.cxx:254
 TXSocket.cxx:255
 TXSocket.cxx:256
 TXSocket.cxx:257
 TXSocket.cxx:258
 TXSocket.cxx:259
 TXSocket.cxx:260
 TXSocket.cxx:261
 TXSocket.cxx:262
 TXSocket.cxx:263
 TXSocket.cxx:264
 TXSocket.cxx:265
 TXSocket.cxx:266
 TXSocket.cxx:267
 TXSocket.cxx:268
 TXSocket.cxx:269
 TXSocket.cxx:270
 TXSocket.cxx:271
 TXSocket.cxx:272
 TXSocket.cxx:273
 TXSocket.cxx:274
 TXSocket.cxx:275
 TXSocket.cxx:276
 TXSocket.cxx:277
 TXSocket.cxx:278
 TXSocket.cxx:279
 TXSocket.cxx:280
 TXSocket.cxx:281
 TXSocket.cxx:282
 TXSocket.cxx:283
 TXSocket.cxx:284
 TXSocket.cxx:285
 TXSocket.cxx:286
 TXSocket.cxx:287
 TXSocket.cxx:288
 TXSocket.cxx:289
 TXSocket.cxx:290
 TXSocket.cxx:291
 TXSocket.cxx:292
 TXSocket.cxx:293
 TXSocket.cxx:294
 TXSocket.cxx:295
 TXSocket.cxx:296
 TXSocket.cxx:297
 TXSocket.cxx:298
 TXSocket.cxx:299
 TXSocket.cxx:300
 TXSocket.cxx:301
 TXSocket.cxx:302
 TXSocket.cxx:303
 TXSocket.cxx:304
 TXSocket.cxx:305
 TXSocket.cxx:306
 TXSocket.cxx:307
 TXSocket.cxx:308
 TXSocket.cxx:309
 TXSocket.cxx:310
 TXSocket.cxx:311
 TXSocket.cxx:312
 TXSocket.cxx:313
 TXSocket.cxx:314
 TXSocket.cxx:315
 TXSocket.cxx:316
 TXSocket.cxx:317
 TXSocket.cxx:318
 TXSocket.cxx:319
 TXSocket.cxx:320
 TXSocket.cxx:321
 TXSocket.cxx:322
 TXSocket.cxx:323
 TXSocket.cxx:324
 TXSocket.cxx:325
 TXSocket.cxx:326
 TXSocket.cxx:327
 TXSocket.cxx:328
 TXSocket.cxx:329
 TXSocket.cxx:330
 TXSocket.cxx:331
 TXSocket.cxx:332
 TXSocket.cxx:333
 TXSocket.cxx:334
 TXSocket.cxx:335
 TXSocket.cxx:336
 TXSocket.cxx:337
 TXSocket.cxx:338
 TXSocket.cxx:339
 TXSocket.cxx:340
 TXSocket.cxx:341
 TXSocket.cxx:342
 TXSocket.cxx:343
 TXSocket.cxx:344
 TXSocket.cxx:345
 TXSocket.cxx:346
 TXSocket.cxx:347
 TXSocket.cxx:348
 TXSocket.cxx:349
 TXSocket.cxx:350
 TXSocket.cxx:351
 TXSocket.cxx:352
 TXSocket.cxx:353
 TXSocket.cxx:354
 TXSocket.cxx:355
 TXSocket.cxx:356
 TXSocket.cxx:357
 TXSocket.cxx:358
 TXSocket.cxx:359
 TXSocket.cxx:360
 TXSocket.cxx:361
 TXSocket.cxx:362
 TXSocket.cxx:363
 TXSocket.cxx:364
 TXSocket.cxx:365
 TXSocket.cxx:366
 TXSocket.cxx:367
 TXSocket.cxx:368
 TXSocket.cxx:369
 TXSocket.cxx:370
 TXSocket.cxx:371
 TXSocket.cxx:372
 TXSocket.cxx:373
 TXSocket.cxx:374
 TXSocket.cxx:375
 TXSocket.cxx:376
 TXSocket.cxx:377
 TXSocket.cxx:378
 TXSocket.cxx:379
 TXSocket.cxx:380
 TXSocket.cxx:381
 TXSocket.cxx:382
 TXSocket.cxx:383
 TXSocket.cxx:384
 TXSocket.cxx:385
 TXSocket.cxx:386
 TXSocket.cxx:387
 TXSocket.cxx:388
 TXSocket.cxx:389
 TXSocket.cxx:390
 TXSocket.cxx:391
 TXSocket.cxx:392
 TXSocket.cxx:393
 TXSocket.cxx:394
 TXSocket.cxx:395
 TXSocket.cxx:396
 TXSocket.cxx:397
 TXSocket.cxx:398
 TXSocket.cxx:399
 TXSocket.cxx:400
 TXSocket.cxx:401
 TXSocket.cxx:402
 TXSocket.cxx:403
 TXSocket.cxx:404
 TXSocket.cxx:405
 TXSocket.cxx:406
 TXSocket.cxx:407
 TXSocket.cxx:408
 TXSocket.cxx:409
 TXSocket.cxx:410
 TXSocket.cxx:411
 TXSocket.cxx:412
 TXSocket.cxx:413
 TXSocket.cxx:414
 TXSocket.cxx:415
 TXSocket.cxx:416
 TXSocket.cxx:417
 TXSocket.cxx:418
 TXSocket.cxx:419
 TXSocket.cxx:420
 TXSocket.cxx:421
 TXSocket.cxx:422
 TXSocket.cxx:423
 TXSocket.cxx:424
 TXSocket.cxx:425
 TXSocket.cxx:426
 TXSocket.cxx:427
 TXSocket.cxx:428
 TXSocket.cxx:429
 TXSocket.cxx:430
 TXSocket.cxx:431
 TXSocket.cxx:432
 TXSocket.cxx:433
 TXSocket.cxx:434
 TXSocket.cxx:435
 TXSocket.cxx:436
 TXSocket.cxx:437
 TXSocket.cxx:438
 TXSocket.cxx:439
 TXSocket.cxx:440
 TXSocket.cxx:441
 TXSocket.cxx:442
 TXSocket.cxx:443
 TXSocket.cxx:444
 TXSocket.cxx:445
 TXSocket.cxx:446
 TXSocket.cxx:447
 TXSocket.cxx:448
 TXSocket.cxx:449
 TXSocket.cxx:450
 TXSocket.cxx:451
 TXSocket.cxx:452
 TXSocket.cxx:453
 TXSocket.cxx:454
 TXSocket.cxx:455
 TXSocket.cxx:456
 TXSocket.cxx:457
 TXSocket.cxx:458
 TXSocket.cxx:459
 TXSocket.cxx:460
 TXSocket.cxx:461
 TXSocket.cxx:462
 TXSocket.cxx:463
 TXSocket.cxx:464
 TXSocket.cxx:465
 TXSocket.cxx:466
 TXSocket.cxx:467
 TXSocket.cxx:468
 TXSocket.cxx:469
 TXSocket.cxx:470
 TXSocket.cxx:471
 TXSocket.cxx:472
 TXSocket.cxx:473
 TXSocket.cxx:474
 TXSocket.cxx:475
 TXSocket.cxx:476
 TXSocket.cxx:477
 TXSocket.cxx:478
 TXSocket.cxx:479
 TXSocket.cxx:480
 TXSocket.cxx:481
 TXSocket.cxx:482
 TXSocket.cxx:483
 TXSocket.cxx:484
 TXSocket.cxx:485
 TXSocket.cxx:486
 TXSocket.cxx:487
 TXSocket.cxx:488
 TXSocket.cxx:489
 TXSocket.cxx:490
 TXSocket.cxx:491
 TXSocket.cxx:492
 TXSocket.cxx:493
 TXSocket.cxx:494
 TXSocket.cxx:495
 TXSocket.cxx:496
 TXSocket.cxx:497
 TXSocket.cxx:498
 TXSocket.cxx:499
 TXSocket.cxx:500
 TXSocket.cxx:501
 TXSocket.cxx:502
 TXSocket.cxx:503
 TXSocket.cxx:504
 TXSocket.cxx:505
 TXSocket.cxx:506
 TXSocket.cxx:507
 TXSocket.cxx:508
 TXSocket.cxx:509
 TXSocket.cxx:510
 TXSocket.cxx:511
 TXSocket.cxx:512
 TXSocket.cxx:513
 TXSocket.cxx:514
 TXSocket.cxx:515
 TXSocket.cxx:516
 TXSocket.cxx:517
 TXSocket.cxx:518
 TXSocket.cxx:519
 TXSocket.cxx:520
 TXSocket.cxx:521
 TXSocket.cxx:522
 TXSocket.cxx:523
 TXSocket.cxx:524
 TXSocket.cxx:525
 TXSocket.cxx:526
 TXSocket.cxx:527
 TXSocket.cxx:528
 TXSocket.cxx:529
 TXSocket.cxx:530
 TXSocket.cxx:531
 TXSocket.cxx:532
 TXSocket.cxx:533
 TXSocket.cxx:534
 TXSocket.cxx:535
 TXSocket.cxx:536
 TXSocket.cxx:537
 TXSocket.cxx:538
 TXSocket.cxx:539
 TXSocket.cxx:540
 TXSocket.cxx:541
 TXSocket.cxx:542
 TXSocket.cxx:543
 TXSocket.cxx:544
 TXSocket.cxx:545
 TXSocket.cxx:546
 TXSocket.cxx:547
 TXSocket.cxx:548
 TXSocket.cxx:549
 TXSocket.cxx:550
 TXSocket.cxx:551
 TXSocket.cxx:552
 TXSocket.cxx:553
 TXSocket.cxx:554
 TXSocket.cxx:555
 TXSocket.cxx:556
 TXSocket.cxx:557
 TXSocket.cxx:558
 TXSocket.cxx:559
 TXSocket.cxx:560
 TXSocket.cxx:561
 TXSocket.cxx:562
 TXSocket.cxx:563
 TXSocket.cxx:564
 TXSocket.cxx:565
 TXSocket.cxx:566
 TXSocket.cxx:567
 TXSocket.cxx:568
 TXSocket.cxx:569
 TXSocket.cxx:570
 TXSocket.cxx:571
 TXSocket.cxx:572
 TXSocket.cxx:573
 TXSocket.cxx:574
 TXSocket.cxx:575
 TXSocket.cxx:576
 TXSocket.cxx:577
 TXSocket.cxx:578
 TXSocket.cxx:579
 TXSocket.cxx:580
 TXSocket.cxx:581
 TXSocket.cxx:582
 TXSocket.cxx:583
 TXSocket.cxx:584
 TXSocket.cxx:585
 TXSocket.cxx:586
 TXSocket.cxx:587
 TXSocket.cxx:588
 TXSocket.cxx:589
 TXSocket.cxx:590
 TXSocket.cxx:591
 TXSocket.cxx:592
 TXSocket.cxx:593
 TXSocket.cxx:594
 TXSocket.cxx:595
 TXSocket.cxx:596
 TXSocket.cxx:597
 TXSocket.cxx:598
 TXSocket.cxx:599
 TXSocket.cxx:600
 TXSocket.cxx:601
 TXSocket.cxx:602
 TXSocket.cxx:603
 TXSocket.cxx:604
 TXSocket.cxx:605
 TXSocket.cxx:606
 TXSocket.cxx:607
 TXSocket.cxx:608
 TXSocket.cxx:609
 TXSocket.cxx:610
 TXSocket.cxx:611
 TXSocket.cxx:612
 TXSocket.cxx:613
 TXSocket.cxx:614
 TXSocket.cxx:615
 TXSocket.cxx:616
 TXSocket.cxx:617
 TXSocket.cxx:618
 TXSocket.cxx:619
 TXSocket.cxx:620
 TXSocket.cxx:621
 TXSocket.cxx:622
 TXSocket.cxx:623
 TXSocket.cxx:624
 TXSocket.cxx:625
 TXSocket.cxx:626
 TXSocket.cxx:627
 TXSocket.cxx:628
 TXSocket.cxx:629
 TXSocket.cxx:630
 TXSocket.cxx:631
 TXSocket.cxx:632
 TXSocket.cxx:633
 TXSocket.cxx:634
 TXSocket.cxx:635
 TXSocket.cxx:636
 TXSocket.cxx:637
 TXSocket.cxx:638
 TXSocket.cxx:639
 TXSocket.cxx:640
 TXSocket.cxx:641
 TXSocket.cxx:642
 TXSocket.cxx:643
 TXSocket.cxx:644
 TXSocket.cxx:645
 TXSocket.cxx:646
 TXSocket.cxx:647
 TXSocket.cxx:648
 TXSocket.cxx:649
 TXSocket.cxx:650
 TXSocket.cxx:651
 TXSocket.cxx:652
 TXSocket.cxx:653
 TXSocket.cxx:654
 TXSocket.cxx:655
 TXSocket.cxx:656
 TXSocket.cxx:657
 TXSocket.cxx:658
 TXSocket.cxx:659
 TXSocket.cxx:660
 TXSocket.cxx:661
 TXSocket.cxx:662
 TXSocket.cxx:663
 TXSocket.cxx:664
 TXSocket.cxx:665
 TXSocket.cxx:666
 TXSocket.cxx:667
 TXSocket.cxx:668
 TXSocket.cxx:669
 TXSocket.cxx:670
 TXSocket.cxx:671
 TXSocket.cxx:672
 TXSocket.cxx:673
 TXSocket.cxx:674
 TXSocket.cxx:675
 TXSocket.cxx:676
 TXSocket.cxx:677
 TXSocket.cxx:678
 TXSocket.cxx:679
 TXSocket.cxx:680
 TXSocket.cxx:681
 TXSocket.cxx:682
 TXSocket.cxx:683
 TXSocket.cxx:684
 TXSocket.cxx:685
 TXSocket.cxx:686
 TXSocket.cxx:687
 TXSocket.cxx:688
 TXSocket.cxx:689
 TXSocket.cxx:690
 TXSocket.cxx:691
 TXSocket.cxx:692
 TXSocket.cxx:693
 TXSocket.cxx:694
 TXSocket.cxx:695
 TXSocket.cxx:696
 TXSocket.cxx:697
 TXSocket.cxx:698
 TXSocket.cxx:699
 TXSocket.cxx:700
 TXSocket.cxx:701
 TXSocket.cxx:702
 TXSocket.cxx:703
 TXSocket.cxx:704
 TXSocket.cxx:705
 TXSocket.cxx:706
 TXSocket.cxx:707
 TXSocket.cxx:708
 TXSocket.cxx:709
 TXSocket.cxx:710
 TXSocket.cxx:711
 TXSocket.cxx:712
 TXSocket.cxx:713
 TXSocket.cxx:714
 TXSocket.cxx:715
 TXSocket.cxx:716
 TXSocket.cxx:717
 TXSocket.cxx:718
 TXSocket.cxx:719
 TXSocket.cxx:720
 TXSocket.cxx:721
 TXSocket.cxx:722
 TXSocket.cxx:723
 TXSocket.cxx:724
 TXSocket.cxx:725
 TXSocket.cxx:726
 TXSocket.cxx:727
 TXSocket.cxx:728
 TXSocket.cxx:729
 TXSocket.cxx:730
 TXSocket.cxx:731
 TXSocket.cxx:732
 TXSocket.cxx:733
 TXSocket.cxx:734
 TXSocket.cxx:735
 TXSocket.cxx:736
 TXSocket.cxx:737
 TXSocket.cxx:738
 TXSocket.cxx:739
 TXSocket.cxx:740
 TXSocket.cxx:741
 TXSocket.cxx:742
 TXSocket.cxx:743
 TXSocket.cxx:744
 TXSocket.cxx:745
 TXSocket.cxx:746
 TXSocket.cxx:747
 TXSocket.cxx:748
 TXSocket.cxx:749
 TXSocket.cxx:750
 TXSocket.cxx:751
 TXSocket.cxx:752
 TXSocket.cxx:753
 TXSocket.cxx:754
 TXSocket.cxx:755
 TXSocket.cxx:756
 TXSocket.cxx:757
 TXSocket.cxx:758
 TXSocket.cxx:759
 TXSocket.cxx:760
 TXSocket.cxx:761
 TXSocket.cxx:762
 TXSocket.cxx:763
 TXSocket.cxx:764
 TXSocket.cxx:765
 TXSocket.cxx:766
 TXSocket.cxx:767
 TXSocket.cxx:768
 TXSocket.cxx:769
 TXSocket.cxx:770
 TXSocket.cxx:771
 TXSocket.cxx:772
 TXSocket.cxx:773
 TXSocket.cxx:774
 TXSocket.cxx:775
 TXSocket.cxx:776
 TXSocket.cxx:777
 TXSocket.cxx:778
 TXSocket.cxx:779
 TXSocket.cxx:780
 TXSocket.cxx:781
 TXSocket.cxx:782
 TXSocket.cxx:783
 TXSocket.cxx:784
 TXSocket.cxx:785
 TXSocket.cxx:786
 TXSocket.cxx:787
 TXSocket.cxx:788
 TXSocket.cxx:789
 TXSocket.cxx:790
 TXSocket.cxx:791
 TXSocket.cxx:792
 TXSocket.cxx:793
 TXSocket.cxx:794
 TXSocket.cxx:795
 TXSocket.cxx:796
 TXSocket.cxx:797
 TXSocket.cxx:798
 TXSocket.cxx:799
 TXSocket.cxx:800
 TXSocket.cxx:801
 TXSocket.cxx:802
 TXSocket.cxx:803
 TXSocket.cxx:804
 TXSocket.cxx:805
 TXSocket.cxx:806
 TXSocket.cxx:807
 TXSocket.cxx:808
 TXSocket.cxx:809
 TXSocket.cxx:810
 TXSocket.cxx:811
 TXSocket.cxx:812
 TXSocket.cxx:813
 TXSocket.cxx:814
 TXSocket.cxx:815
 TXSocket.cxx:816
 TXSocket.cxx:817
 TXSocket.cxx:818
 TXSocket.cxx:819
 TXSocket.cxx:820
 TXSocket.cxx:821
 TXSocket.cxx:822
 TXSocket.cxx:823
 TXSocket.cxx:824
 TXSocket.cxx:825
 TXSocket.cxx:826
 TXSocket.cxx:827
 TXSocket.cxx:828
 TXSocket.cxx:829
 TXSocket.cxx:830
 TXSocket.cxx:831
 TXSocket.cxx:832
 TXSocket.cxx:833
 TXSocket.cxx:834
 TXSocket.cxx:835
 TXSocket.cxx:836
 TXSocket.cxx:837
 TXSocket.cxx:838
 TXSocket.cxx:839
 TXSocket.cxx:840
 TXSocket.cxx:841
 TXSocket.cxx:842
 TXSocket.cxx:843
 TXSocket.cxx:844
 TXSocket.cxx:845
 TXSocket.cxx:846
 TXSocket.cxx:847
 TXSocket.cxx:848
 TXSocket.cxx:849
 TXSocket.cxx:850
 TXSocket.cxx:851
 TXSocket.cxx:852
 TXSocket.cxx:853
 TXSocket.cxx:854
 TXSocket.cxx:855
 TXSocket.cxx:856
 TXSocket.cxx:857
 TXSocket.cxx:858
 TXSocket.cxx:859
 TXSocket.cxx:860
 TXSocket.cxx:861
 TXSocket.cxx:862
 TXSocket.cxx:863
 TXSocket.cxx:864
 TXSocket.cxx:865
 TXSocket.cxx:866
 TXSocket.cxx:867
 TXSocket.cxx:868
 TXSocket.cxx:869
 TXSocket.cxx:870
 TXSocket.cxx:871
 TXSocket.cxx:872
 TXSocket.cxx:873
 TXSocket.cxx:874
 TXSocket.cxx:875
 TXSocket.cxx:876
 TXSocket.cxx:877
 TXSocket.cxx:878
 TXSocket.cxx:879
 TXSocket.cxx:880
 TXSocket.cxx:881
 TXSocket.cxx:882
 TXSocket.cxx:883
 TXSocket.cxx:884
 TXSocket.cxx:885
 TXSocket.cxx:886
 TXSocket.cxx:887
 TXSocket.cxx:888
 TXSocket.cxx:889
 TXSocket.cxx:890
 TXSocket.cxx:891
 TXSocket.cxx:892
 TXSocket.cxx:893
 TXSocket.cxx:894
 TXSocket.cxx:895
 TXSocket.cxx:896
 TXSocket.cxx:897
 TXSocket.cxx:898
 TXSocket.cxx:899
 TXSocket.cxx:900
 TXSocket.cxx:901
 TXSocket.cxx:902
 TXSocket.cxx:903
 TXSocket.cxx:904
 TXSocket.cxx:905
 TXSocket.cxx:906
 TXSocket.cxx:907
 TXSocket.cxx:908
 TXSocket.cxx:909
 TXSocket.cxx:910
 TXSocket.cxx:911
 TXSocket.cxx:912
 TXSocket.cxx:913
 TXSocket.cxx:914
 TXSocket.cxx:915
 TXSocket.cxx:916
 TXSocket.cxx:917
 TXSocket.cxx:918
 TXSocket.cxx:919
 TXSocket.cxx:920
 TXSocket.cxx:921
 TXSocket.cxx:922
 TXSocket.cxx:923
 TXSocket.cxx:924
 TXSocket.cxx:925
 TXSocket.cxx:926
 TXSocket.cxx:927
 TXSocket.cxx:928
 TXSocket.cxx:929
 TXSocket.cxx:930
 TXSocket.cxx:931
 TXSocket.cxx:932
 TXSocket.cxx:933
 TXSocket.cxx:934
 TXSocket.cxx:935
 TXSocket.cxx:936
 TXSocket.cxx:937
 TXSocket.cxx:938
 TXSocket.cxx:939
 TXSocket.cxx:940
 TXSocket.cxx:941
 TXSocket.cxx:942
 TXSocket.cxx:943
 TXSocket.cxx:944
 TXSocket.cxx:945
 TXSocket.cxx:946
 TXSocket.cxx:947
 TXSocket.cxx:948
 TXSocket.cxx:949
 TXSocket.cxx:950
 TXSocket.cxx:951
 TXSocket.cxx:952
 TXSocket.cxx:953
 TXSocket.cxx:954
 TXSocket.cxx:955
 TXSocket.cxx:956
 TXSocket.cxx:957
 TXSocket.cxx:958
 TXSocket.cxx:959
 TXSocket.cxx:960
 TXSocket.cxx:961
 TXSocket.cxx:962
 TXSocket.cxx:963
 TXSocket.cxx:964
 TXSocket.cxx:965
 TXSocket.cxx:966
 TXSocket.cxx:967
 TXSocket.cxx:968
 TXSocket.cxx:969
 TXSocket.cxx:970
 TXSocket.cxx:971
 TXSocket.cxx:972
 TXSocket.cxx:973
 TXSocket.cxx:974
 TXSocket.cxx:975
 TXSocket.cxx:976
 TXSocket.cxx:977
 TXSocket.cxx:978
 TXSocket.cxx:979
 TXSocket.cxx:980
 TXSocket.cxx:981
 TXSocket.cxx:982
 TXSocket.cxx:983
 TXSocket.cxx:984
 TXSocket.cxx:985
 TXSocket.cxx:986
 TXSocket.cxx:987
 TXSocket.cxx:988
 TXSocket.cxx:989
 TXSocket.cxx:990
 TXSocket.cxx:991
 TXSocket.cxx:992
 TXSocket.cxx:993
 TXSocket.cxx:994
 TXSocket.cxx:995
 TXSocket.cxx:996
 TXSocket.cxx:997
 TXSocket.cxx:998
 TXSocket.cxx:999
 TXSocket.cxx:1000
 TXSocket.cxx:1001
 TXSocket.cxx:1002
 TXSocket.cxx:1003
 TXSocket.cxx:1004
 TXSocket.cxx:1005
 TXSocket.cxx:1006
 TXSocket.cxx:1007
 TXSocket.cxx:1008
 TXSocket.cxx:1009
 TXSocket.cxx:1010
 TXSocket.cxx:1011
 TXSocket.cxx:1012
 TXSocket.cxx:1013
 TXSocket.cxx:1014
 TXSocket.cxx:1015
 TXSocket.cxx:1016
 TXSocket.cxx:1017
 TXSocket.cxx:1018
 TXSocket.cxx:1019
 TXSocket.cxx:1020
 TXSocket.cxx:1021
 TXSocket.cxx:1022
 TXSocket.cxx:1023
 TXSocket.cxx:1024
 TXSocket.cxx:1025
 TXSocket.cxx:1026
 TXSocket.cxx:1027
 TXSocket.cxx:1028
 TXSocket.cxx:1029
 TXSocket.cxx:1030
 TXSocket.cxx:1031
 TXSocket.cxx:1032
 TXSocket.cxx:1033
 TXSocket.cxx:1034
 TXSocket.cxx:1035
 TXSocket.cxx:1036
 TXSocket.cxx:1037
 TXSocket.cxx:1038
 TXSocket.cxx:1039
 TXSocket.cxx:1040
 TXSocket.cxx:1041
 TXSocket.cxx:1042
 TXSocket.cxx:1043
 TXSocket.cxx:1044
 TXSocket.cxx:1045
 TXSocket.cxx:1046
 TXSocket.cxx:1047
 TXSocket.cxx:1048
 TXSocket.cxx:1049
 TXSocket.cxx:1050
 TXSocket.cxx:1051
 TXSocket.cxx:1052
 TXSocket.cxx:1053
 TXSocket.cxx:1054
 TXSocket.cxx:1055
 TXSocket.cxx:1056
 TXSocket.cxx:1057
 TXSocket.cxx:1058
 TXSocket.cxx:1059
 TXSocket.cxx:1060
 TXSocket.cxx:1061
 TXSocket.cxx:1062
 TXSocket.cxx:1063
 TXSocket.cxx:1064
 TXSocket.cxx:1065
 TXSocket.cxx:1066
 TXSocket.cxx:1067
 TXSocket.cxx:1068
 TXSocket.cxx:1069
 TXSocket.cxx:1070
 TXSocket.cxx:1071
 TXSocket.cxx:1072
 TXSocket.cxx:1073
 TXSocket.cxx:1074
 TXSocket.cxx:1075
 TXSocket.cxx:1076
 TXSocket.cxx:1077
 TXSocket.cxx:1078
 TXSocket.cxx:1079
 TXSocket.cxx:1080
 TXSocket.cxx:1081
 TXSocket.cxx:1082
 TXSocket.cxx:1083
 TXSocket.cxx:1084
 TXSocket.cxx:1085
 TXSocket.cxx:1086
 TXSocket.cxx:1087
 TXSocket.cxx:1088
 TXSocket.cxx:1089
 TXSocket.cxx:1090
 TXSocket.cxx:1091
 TXSocket.cxx:1092
 TXSocket.cxx:1093
 TXSocket.cxx:1094
 TXSocket.cxx:1095
 TXSocket.cxx:1096
 TXSocket.cxx:1097
 TXSocket.cxx:1098
 TXSocket.cxx:1099
 TXSocket.cxx:1100
 TXSocket.cxx:1101
 TXSocket.cxx:1102
 TXSocket.cxx:1103
 TXSocket.cxx:1104
 TXSocket.cxx:1105
 TXSocket.cxx:1106
 TXSocket.cxx:1107
 TXSocket.cxx:1108
 TXSocket.cxx:1109
 TXSocket.cxx:1110
 TXSocket.cxx:1111
 TXSocket.cxx:1112
 TXSocket.cxx:1113
 TXSocket.cxx:1114
 TXSocket.cxx:1115
 TXSocket.cxx:1116
 TXSocket.cxx:1117
 TXSocket.cxx:1118
 TXSocket.cxx:1119
 TXSocket.cxx:1120
 TXSocket.cxx:1121
 TXSocket.cxx:1122
 TXSocket.cxx:1123
 TXSocket.cxx:1124
 TXSocket.cxx:1125
 TXSocket.cxx:1126
 TXSocket.cxx:1127
 TXSocket.cxx:1128
 TXSocket.cxx:1129
 TXSocket.cxx:1130
 TXSocket.cxx:1131
 TXSocket.cxx:1132
 TXSocket.cxx:1133
 TXSocket.cxx:1134
 TXSocket.cxx:1135
 TXSocket.cxx:1136
 TXSocket.cxx:1137
 TXSocket.cxx:1138
 TXSocket.cxx:1139
 TXSocket.cxx:1140
 TXSocket.cxx:1141
 TXSocket.cxx:1142
 TXSocket.cxx:1143
 TXSocket.cxx:1144
 TXSocket.cxx:1145
 TXSocket.cxx:1146
 TXSocket.cxx:1147
 TXSocket.cxx:1148
 TXSocket.cxx:1149
 TXSocket.cxx:1150
 TXSocket.cxx:1151
 TXSocket.cxx:1152
 TXSocket.cxx:1153
 TXSocket.cxx:1154
 TXSocket.cxx:1155
 TXSocket.cxx:1156
 TXSocket.cxx:1157
 TXSocket.cxx:1158
 TXSocket.cxx:1159
 TXSocket.cxx:1160
 TXSocket.cxx:1161
 TXSocket.cxx:1162
 TXSocket.cxx:1163
 TXSocket.cxx:1164
 TXSocket.cxx:1165
 TXSocket.cxx:1166
 TXSocket.cxx:1167
 TXSocket.cxx:1168
 TXSocket.cxx:1169
 TXSocket.cxx:1170
 TXSocket.cxx:1171
 TXSocket.cxx:1172
 TXSocket.cxx:1173
 TXSocket.cxx:1174
 TXSocket.cxx:1175
 TXSocket.cxx:1176
 TXSocket.cxx:1177
 TXSocket.cxx:1178
 TXSocket.cxx:1179
 TXSocket.cxx:1180
 TXSocket.cxx:1181
 TXSocket.cxx:1182
 TXSocket.cxx:1183
 TXSocket.cxx:1184
 TXSocket.cxx:1185
 TXSocket.cxx:1186
 TXSocket.cxx:1187
 TXSocket.cxx:1188
 TXSocket.cxx:1189
 TXSocket.cxx:1190
 TXSocket.cxx:1191
 TXSocket.cxx:1192
 TXSocket.cxx:1193
 TXSocket.cxx:1194
 TXSocket.cxx:1195
 TXSocket.cxx:1196
 TXSocket.cxx:1197
 TXSocket.cxx:1198
 TXSocket.cxx:1199
 TXSocket.cxx:1200
 TXSocket.cxx:1201
 TXSocket.cxx:1202
 TXSocket.cxx:1203
 TXSocket.cxx:1204
 TXSocket.cxx:1205
 TXSocket.cxx:1206
 TXSocket.cxx:1207
 TXSocket.cxx:1208
 TXSocket.cxx:1209
 TXSocket.cxx:1210
 TXSocket.cxx:1211
 TXSocket.cxx:1212
 TXSocket.cxx:1213
 TXSocket.cxx:1214
 TXSocket.cxx:1215
 TXSocket.cxx:1216
 TXSocket.cxx:1217
 TXSocket.cxx:1218
 TXSocket.cxx:1219
 TXSocket.cxx:1220
 TXSocket.cxx:1221
 TXSocket.cxx:1222
 TXSocket.cxx:1223
 TXSocket.cxx:1224
 TXSocket.cxx:1225
 TXSocket.cxx:1226
 TXSocket.cxx:1227
 TXSocket.cxx:1228
 TXSocket.cxx:1229
 TXSocket.cxx:1230
 TXSocket.cxx:1231
 TXSocket.cxx:1232
 TXSocket.cxx:1233
 TXSocket.cxx:1234
 TXSocket.cxx:1235
 TXSocket.cxx:1236
 TXSocket.cxx:1237
 TXSocket.cxx:1238
 TXSocket.cxx:1239
 TXSocket.cxx:1240
 TXSocket.cxx:1241
 TXSocket.cxx:1242
 TXSocket.cxx:1243
 TXSocket.cxx:1244
 TXSocket.cxx:1245
 TXSocket.cxx:1246
 TXSocket.cxx:1247
 TXSocket.cxx:1248
 TXSocket.cxx:1249
 TXSocket.cxx:1250
 TXSocket.cxx:1251
 TXSocket.cxx:1252
 TXSocket.cxx:1253
 TXSocket.cxx:1254
 TXSocket.cxx:1255
 TXSocket.cxx:1256
 TXSocket.cxx:1257
 TXSocket.cxx:1258
 TXSocket.cxx:1259
 TXSocket.cxx:1260
 TXSocket.cxx:1261
 TXSocket.cxx:1262
 TXSocket.cxx:1263
 TXSocket.cxx:1264
 TXSocket.cxx:1265
 TXSocket.cxx:1266
 TXSocket.cxx:1267
 TXSocket.cxx:1268
 TXSocket.cxx:1269
 TXSocket.cxx:1270
 TXSocket.cxx:1271
 TXSocket.cxx:1272
 TXSocket.cxx:1273
 TXSocket.cxx:1274
 TXSocket.cxx:1275
 TXSocket.cxx:1276
 TXSocket.cxx:1277
 TXSocket.cxx:1278
 TXSocket.cxx:1279
 TXSocket.cxx:1280
 TXSocket.cxx:1281
 TXSocket.cxx:1282
 TXSocket.cxx:1283
 TXSocket.cxx:1284
 TXSocket.cxx:1285
 TXSocket.cxx:1286
 TXSocket.cxx:1287
 TXSocket.cxx:1288
 TXSocket.cxx:1289
 TXSocket.cxx:1290
 TXSocket.cxx:1291
 TXSocket.cxx:1292
 TXSocket.cxx:1293
 TXSocket.cxx:1294
 TXSocket.cxx:1295
 TXSocket.cxx:1296
 TXSocket.cxx:1297
 TXSocket.cxx:1298
 TXSocket.cxx:1299
 TXSocket.cxx:1300
 TXSocket.cxx:1301
 TXSocket.cxx:1302
 TXSocket.cxx:1303
 TXSocket.cxx:1304
 TXSocket.cxx:1305
 TXSocket.cxx:1306
 TXSocket.cxx:1307
 TXSocket.cxx:1308
 TXSocket.cxx:1309
 TXSocket.cxx:1310
 TXSocket.cxx:1311
 TXSocket.cxx:1312
 TXSocket.cxx:1313
 TXSocket.cxx:1314
 TXSocket.cxx:1315
 TXSocket.cxx:1316
 TXSocket.cxx:1317
 TXSocket.cxx:1318
 TXSocket.cxx:1319
 TXSocket.cxx:1320
 TXSocket.cxx:1321
 TXSocket.cxx:1322
 TXSocket.cxx:1323
 TXSocket.cxx:1324
 TXSocket.cxx:1325
 TXSocket.cxx:1326
 TXSocket.cxx:1327
 TXSocket.cxx:1328
 TXSocket.cxx:1329
 TXSocket.cxx:1330
 TXSocket.cxx:1331
 TXSocket.cxx:1332
 TXSocket.cxx:1333
 TXSocket.cxx:1334
 TXSocket.cxx:1335
 TXSocket.cxx:1336
 TXSocket.cxx:1337
 TXSocket.cxx:1338
 TXSocket.cxx:1339
 TXSocket.cxx:1340
 TXSocket.cxx:1341
 TXSocket.cxx:1342
 TXSocket.cxx:1343
 TXSocket.cxx:1344
 TXSocket.cxx:1345
 TXSocket.cxx:1346
 TXSocket.cxx:1347
 TXSocket.cxx:1348
 TXSocket.cxx:1349
 TXSocket.cxx:1350
 TXSocket.cxx:1351
 TXSocket.cxx:1352
 TXSocket.cxx:1353
 TXSocket.cxx:1354
 TXSocket.cxx:1355
 TXSocket.cxx:1356
 TXSocket.cxx:1357
 TXSocket.cxx:1358
 TXSocket.cxx:1359
 TXSocket.cxx:1360
 TXSocket.cxx:1361
 TXSocket.cxx:1362
 TXSocket.cxx:1363
 TXSocket.cxx:1364
 TXSocket.cxx:1365
 TXSocket.cxx:1366
 TXSocket.cxx:1367
 TXSocket.cxx:1368
 TXSocket.cxx:1369
 TXSocket.cxx:1370
 TXSocket.cxx:1371
 TXSocket.cxx:1372
 TXSocket.cxx:1373
 TXSocket.cxx:1374
 TXSocket.cxx:1375
 TXSocket.cxx:1376
 TXSocket.cxx:1377
 TXSocket.cxx:1378
 TXSocket.cxx:1379
 TXSocket.cxx:1380
 TXSocket.cxx:1381
 TXSocket.cxx:1382
 TXSocket.cxx:1383
 TXSocket.cxx:1384
 TXSocket.cxx:1385
 TXSocket.cxx:1386
 TXSocket.cxx:1387
 TXSocket.cxx:1388
 TXSocket.cxx:1389
 TXSocket.cxx:1390
 TXSocket.cxx:1391
 TXSocket.cxx:1392
 TXSocket.cxx:1393
 TXSocket.cxx:1394
 TXSocket.cxx:1395
 TXSocket.cxx:1396
 TXSocket.cxx:1397
 TXSocket.cxx:1398
 TXSocket.cxx:1399
 TXSocket.cxx:1400
 TXSocket.cxx:1401
 TXSocket.cxx:1402
 TXSocket.cxx:1403
 TXSocket.cxx:1404
 TXSocket.cxx:1405
 TXSocket.cxx:1406
 TXSocket.cxx:1407
 TXSocket.cxx:1408
 TXSocket.cxx:1409
 TXSocket.cxx:1410
 TXSocket.cxx:1411
 TXSocket.cxx:1412
 TXSocket.cxx:1413
 TXSocket.cxx:1414
 TXSocket.cxx:1415
 TXSocket.cxx:1416
 TXSocket.cxx:1417
 TXSocket.cxx:1418
 TXSocket.cxx:1419
 TXSocket.cxx:1420
 TXSocket.cxx:1421
 TXSocket.cxx:1422
 TXSocket.cxx:1423
 TXSocket.cxx:1424
 TXSocket.cxx:1425
 TXSocket.cxx:1426
 TXSocket.cxx:1427
 TXSocket.cxx:1428
 TXSocket.cxx:1429
 TXSocket.cxx:1430
 TXSocket.cxx:1431
 TXSocket.cxx:1432
 TXSocket.cxx:1433
 TXSocket.cxx:1434
 TXSocket.cxx:1435
 TXSocket.cxx:1436
 TXSocket.cxx:1437
 TXSocket.cxx:1438
 TXSocket.cxx:1439
 TXSocket.cxx:1440
 TXSocket.cxx:1441
 TXSocket.cxx:1442
 TXSocket.cxx:1443
 TXSocket.cxx:1444
 TXSocket.cxx:1445
 TXSocket.cxx:1446
 TXSocket.cxx:1447
 TXSocket.cxx:1448
 TXSocket.cxx:1449
 TXSocket.cxx:1450
 TXSocket.cxx:1451
 TXSocket.cxx:1452
 TXSocket.cxx:1453
 TXSocket.cxx:1454
 TXSocket.cxx:1455
 TXSocket.cxx:1456
 TXSocket.cxx:1457
 TXSocket.cxx:1458
 TXSocket.cxx:1459
 TXSocket.cxx:1460
 TXSocket.cxx:1461
 TXSocket.cxx:1462
 TXSocket.cxx:1463
 TXSocket.cxx:1464
 TXSocket.cxx:1465
 TXSocket.cxx:1466
 TXSocket.cxx:1467
 TXSocket.cxx:1468
 TXSocket.cxx:1469
 TXSocket.cxx:1470
 TXSocket.cxx:1471
 TXSocket.cxx:1472
 TXSocket.cxx:1473
 TXSocket.cxx:1474
 TXSocket.cxx:1475
 TXSocket.cxx:1476
 TXSocket.cxx:1477
 TXSocket.cxx:1478
 TXSocket.cxx:1479
 TXSocket.cxx:1480
 TXSocket.cxx:1481
 TXSocket.cxx:1482
 TXSocket.cxx:1483
 TXSocket.cxx:1484
 TXSocket.cxx:1485
 TXSocket.cxx:1486
 TXSocket.cxx:1487
 TXSocket.cxx:1488
 TXSocket.cxx:1489
 TXSocket.cxx:1490
 TXSocket.cxx:1491
 TXSocket.cxx:1492
 TXSocket.cxx:1493
 TXSocket.cxx:1494
 TXSocket.cxx:1495
 TXSocket.cxx:1496
 TXSocket.cxx:1497
 TXSocket.cxx:1498
 TXSocket.cxx:1499
 TXSocket.cxx:1500
 TXSocket.cxx:1501
 TXSocket.cxx:1502
 TXSocket.cxx:1503
 TXSocket.cxx:1504
 TXSocket.cxx:1505
 TXSocket.cxx:1506
 TXSocket.cxx:1507
 TXSocket.cxx:1508
 TXSocket.cxx:1509
 TXSocket.cxx:1510
 TXSocket.cxx:1511
 TXSocket.cxx:1512
 TXSocket.cxx:1513
 TXSocket.cxx:1514
 TXSocket.cxx:1515
 TXSocket.cxx:1516
 TXSocket.cxx:1517
 TXSocket.cxx:1518
 TXSocket.cxx:1519
 TXSocket.cxx:1520
 TXSocket.cxx:1521
 TXSocket.cxx:1522
 TXSocket.cxx:1523
 TXSocket.cxx:1524
 TXSocket.cxx:1525
 TXSocket.cxx:1526
 TXSocket.cxx:1527
 TXSocket.cxx:1528
 TXSocket.cxx:1529
 TXSocket.cxx:1530
 TXSocket.cxx:1531
 TXSocket.cxx:1532
 TXSocket.cxx:1533
 TXSocket.cxx:1534
 TXSocket.cxx:1535
 TXSocket.cxx:1536
 TXSocket.cxx:1537
 TXSocket.cxx:1538
 TXSocket.cxx:1539
 TXSocket.cxx:1540
 TXSocket.cxx:1541
 TXSocket.cxx:1542
 TXSocket.cxx:1543
 TXSocket.cxx:1544
 TXSocket.cxx:1545
 TXSocket.cxx:1546
 TXSocket.cxx:1547
 TXSocket.cxx:1548
 TXSocket.cxx:1549
 TXSocket.cxx:1550
 TXSocket.cxx:1551
 TXSocket.cxx:1552
 TXSocket.cxx:1553
 TXSocket.cxx:1554
 TXSocket.cxx:1555
 TXSocket.cxx:1556
 TXSocket.cxx:1557
 TXSocket.cxx:1558
 TXSocket.cxx:1559
 TXSocket.cxx:1560
 TXSocket.cxx:1561
 TXSocket.cxx:1562
 TXSocket.cxx:1563
 TXSocket.cxx:1564
 TXSocket.cxx:1565
 TXSocket.cxx:1566
 TXSocket.cxx:1567
 TXSocket.cxx:1568
 TXSocket.cxx:1569
 TXSocket.cxx:1570
 TXSocket.cxx:1571
 TXSocket.cxx:1572
 TXSocket.cxx:1573
 TXSocket.cxx:1574
 TXSocket.cxx:1575
 TXSocket.cxx:1576
 TXSocket.cxx:1577
 TXSocket.cxx:1578
 TXSocket.cxx:1579
 TXSocket.cxx:1580
 TXSocket.cxx:1581
 TXSocket.cxx:1582
 TXSocket.cxx:1583
 TXSocket.cxx:1584
 TXSocket.cxx:1585
 TXSocket.cxx:1586
 TXSocket.cxx:1587
 TXSocket.cxx:1588
 TXSocket.cxx:1589
 TXSocket.cxx:1590
 TXSocket.cxx:1591
 TXSocket.cxx:1592
 TXSocket.cxx:1593
 TXSocket.cxx:1594
 TXSocket.cxx:1595
 TXSocket.cxx:1596
 TXSocket.cxx:1597
 TXSocket.cxx:1598
 TXSocket.cxx:1599
 TXSocket.cxx:1600
 TXSocket.cxx:1601
 TXSocket.cxx:1602
 TXSocket.cxx:1603
 TXSocket.cxx:1604
 TXSocket.cxx:1605
 TXSocket.cxx:1606
 TXSocket.cxx:1607
 TXSocket.cxx:1608
 TXSocket.cxx:1609
 TXSocket.cxx:1610
 TXSocket.cxx:1611
 TXSocket.cxx:1612
 TXSocket.cxx:1613
 TXSocket.cxx:1614
 TXSocket.cxx:1615
 TXSocket.cxx:1616
 TXSocket.cxx:1617
 TXSocket.cxx:1618
 TXSocket.cxx:1619
 TXSocket.cxx:1620
 TXSocket.cxx:1621
 TXSocket.cxx:1622
 TXSocket.cxx:1623
 TXSocket.cxx:1624
 TXSocket.cxx:1625
 TXSocket.cxx:1626
 TXSocket.cxx:1627
 TXSocket.cxx:1628
 TXSocket.cxx:1629
 TXSocket.cxx:1630
 TXSocket.cxx:1631
 TXSocket.cxx:1632
 TXSocket.cxx:1633
 TXSocket.cxx:1634
 TXSocket.cxx:1635
 TXSocket.cxx:1636
 TXSocket.cxx:1637
 TXSocket.cxx:1638
 TXSocket.cxx:1639
 TXSocket.cxx:1640
 TXSocket.cxx:1641
 TXSocket.cxx:1642
 TXSocket.cxx:1643
 TXSocket.cxx:1644
 TXSocket.cxx:1645
 TXSocket.cxx:1646
 TXSocket.cxx:1647
 TXSocket.cxx:1648
 TXSocket.cxx:1649
 TXSocket.cxx:1650
 TXSocket.cxx:1651
 TXSocket.cxx:1652
 TXSocket.cxx:1653
 TXSocket.cxx:1654
 TXSocket.cxx:1655
 TXSocket.cxx:1656
 TXSocket.cxx:1657
 TXSocket.cxx:1658
 TXSocket.cxx:1659
 TXSocket.cxx:1660
 TXSocket.cxx:1661
 TXSocket.cxx:1662
 TXSocket.cxx:1663
 TXSocket.cxx:1664
 TXSocket.cxx:1665
 TXSocket.cxx:1666
 TXSocket.cxx:1667
 TXSocket.cxx:1668
 TXSocket.cxx:1669
 TXSocket.cxx:1670
 TXSocket.cxx:1671
 TXSocket.cxx:1672
 TXSocket.cxx:1673
 TXSocket.cxx:1674
 TXSocket.cxx:1675
 TXSocket.cxx:1676
 TXSocket.cxx:1677
 TXSocket.cxx:1678
 TXSocket.cxx:1679
 TXSocket.cxx:1680
 TXSocket.cxx:1681
 TXSocket.cxx:1682
 TXSocket.cxx:1683
 TXSocket.cxx:1684
 TXSocket.cxx:1685
 TXSocket.cxx:1686
 TXSocket.cxx:1687
 TXSocket.cxx:1688
 TXSocket.cxx:1689
 TXSocket.cxx:1690
 TXSocket.cxx:1691
 TXSocket.cxx:1692
 TXSocket.cxx:1693
 TXSocket.cxx:1694
 TXSocket.cxx:1695
 TXSocket.cxx:1696
 TXSocket.cxx:1697
 TXSocket.cxx:1698
 TXSocket.cxx:1699
 TXSocket.cxx:1700
 TXSocket.cxx:1701
 TXSocket.cxx:1702
 TXSocket.cxx:1703
 TXSocket.cxx:1704
 TXSocket.cxx:1705
 TXSocket.cxx:1706
 TXSocket.cxx:1707
 TXSocket.cxx:1708
 TXSocket.cxx:1709
 TXSocket.cxx:1710
 TXSocket.cxx:1711
 TXSocket.cxx:1712
 TXSocket.cxx:1713
 TXSocket.cxx:1714
 TXSocket.cxx:1715
 TXSocket.cxx:1716
 TXSocket.cxx:1717
 TXSocket.cxx:1718
 TXSocket.cxx:1719
 TXSocket.cxx:1720
 TXSocket.cxx:1721
 TXSocket.cxx:1722
 TXSocket.cxx:1723
 TXSocket.cxx:1724
 TXSocket.cxx:1725
 TXSocket.cxx:1726
 TXSocket.cxx:1727
 TXSocket.cxx:1728
 TXSocket.cxx:1729
 TXSocket.cxx:1730
 TXSocket.cxx:1731
 TXSocket.cxx:1732
 TXSocket.cxx:1733
 TXSocket.cxx:1734
 TXSocket.cxx:1735
 TXSocket.cxx:1736
 TXSocket.cxx:1737
 TXSocket.cxx:1738
 TXSocket.cxx:1739
 TXSocket.cxx:1740
 TXSocket.cxx:1741
 TXSocket.cxx:1742
 TXSocket.cxx:1743
 TXSocket.cxx:1744
 TXSocket.cxx:1745
 TXSocket.cxx:1746
 TXSocket.cxx:1747
 TXSocket.cxx:1748
 TXSocket.cxx:1749
 TXSocket.cxx:1750
 TXSocket.cxx:1751
 TXSocket.cxx:1752
 TXSocket.cxx:1753
 TXSocket.cxx:1754
 TXSocket.cxx:1755
 TXSocket.cxx:1756
 TXSocket.cxx:1757
 TXSocket.cxx:1758
 TXSocket.cxx:1759
 TXSocket.cxx:1760
 TXSocket.cxx:1761
 TXSocket.cxx:1762
 TXSocket.cxx:1763
 TXSocket.cxx:1764
 TXSocket.cxx:1765
 TXSocket.cxx:1766
 TXSocket.cxx:1767
 TXSocket.cxx:1768
 TXSocket.cxx:1769
 TXSocket.cxx:1770
 TXSocket.cxx:1771
 TXSocket.cxx:1772
 TXSocket.cxx:1773
 TXSocket.cxx:1774
 TXSocket.cxx:1775
 TXSocket.cxx:1776
 TXSocket.cxx:1777
 TXSocket.cxx:1778
 TXSocket.cxx:1779
 TXSocket.cxx:1780
 TXSocket.cxx:1781
 TXSocket.cxx:1782
 TXSocket.cxx:1783
 TXSocket.cxx:1784
 TXSocket.cxx:1785
 TXSocket.cxx:1786
 TXSocket.cxx:1787
 TXSocket.cxx:1788
 TXSocket.cxx:1789
 TXSocket.cxx:1790
 TXSocket.cxx:1791
 TXSocket.cxx:1792
 TXSocket.cxx:1793
 TXSocket.cxx:1794
 TXSocket.cxx:1795
 TXSocket.cxx:1796
 TXSocket.cxx:1797
 TXSocket.cxx:1798
 TXSocket.cxx:1799
 TXSocket.cxx:1800
 TXSocket.cxx:1801
 TXSocket.cxx:1802
 TXSocket.cxx:1803
 TXSocket.cxx:1804
 TXSocket.cxx:1805
 TXSocket.cxx:1806
 TXSocket.cxx:1807
 TXSocket.cxx:1808
 TXSocket.cxx:1809
 TXSocket.cxx:1810
 TXSocket.cxx:1811
 TXSocket.cxx:1812
 TXSocket.cxx:1813
 TXSocket.cxx:1814
 TXSocket.cxx:1815
 TXSocket.cxx:1816
 TXSocket.cxx:1817
 TXSocket.cxx:1818
 TXSocket.cxx:1819
 TXSocket.cxx:1820
 TXSocket.cxx:1821
 TXSocket.cxx:1822
 TXSocket.cxx:1823
 TXSocket.cxx:1824
 TXSocket.cxx:1825
 TXSocket.cxx:1826
 TXSocket.cxx:1827
 TXSocket.cxx:1828
 TXSocket.cxx:1829
 TXSocket.cxx:1830
 TXSocket.cxx:1831
 TXSocket.cxx:1832
 TXSocket.cxx:1833
 TXSocket.cxx:1834
 TXSocket.cxx:1835
 TXSocket.cxx:1836
 TXSocket.cxx:1837
 TXSocket.cxx:1838
 TXSocket.cxx:1839
 TXSocket.cxx:1840
 TXSocket.cxx:1841
 TXSocket.cxx:1842
 TXSocket.cxx:1843
 TXSocket.cxx:1844
 TXSocket.cxx:1845
 TXSocket.cxx:1846
 TXSocket.cxx:1847
 TXSocket.cxx:1848
 TXSocket.cxx:1849
 TXSocket.cxx:1850
 TXSocket.cxx:1851
 TXSocket.cxx:1852
 TXSocket.cxx:1853
 TXSocket.cxx:1854
 TXSocket.cxx:1855
 TXSocket.cxx:1856
 TXSocket.cxx:1857
 TXSocket.cxx:1858
 TXSocket.cxx:1859
 TXSocket.cxx:1860
 TXSocket.cxx:1861
 TXSocket.cxx:1862
 TXSocket.cxx:1863
 TXSocket.cxx:1864
 TXSocket.cxx:1865
 TXSocket.cxx:1866
 TXSocket.cxx:1867
 TXSocket.cxx:1868
 TXSocket.cxx:1869
 TXSocket.cxx:1870
 TXSocket.cxx:1871
 TXSocket.cxx:1872
 TXSocket.cxx:1873
 TXSocket.cxx:1874
 TXSocket.cxx:1875
 TXSocket.cxx:1876
 TXSocket.cxx:1877
 TXSocket.cxx:1878
 TXSocket.cxx:1879
 TXSocket.cxx:1880
 TXSocket.cxx:1881
 TXSocket.cxx:1882
 TXSocket.cxx:1883
 TXSocket.cxx:1884
 TXSocket.cxx:1885
 TXSocket.cxx:1886
 TXSocket.cxx:1887
 TXSocket.cxx:1888
 TXSocket.cxx:1889
 TXSocket.cxx:1890
 TXSocket.cxx:1891
 TXSocket.cxx:1892
 TXSocket.cxx:1893
 TXSocket.cxx:1894
 TXSocket.cxx:1895
 TXSocket.cxx:1896
 TXSocket.cxx:1897
 TXSocket.cxx:1898
 TXSocket.cxx:1899
 TXSocket.cxx:1900
 TXSocket.cxx:1901
 TXSocket.cxx:1902
 TXSocket.cxx:1903
 TXSocket.cxx:1904
 TXSocket.cxx:1905
 TXSocket.cxx:1906
 TXSocket.cxx:1907
 TXSocket.cxx:1908
 TXSocket.cxx:1909
 TXSocket.cxx:1910
 TXSocket.cxx:1911
 TXSocket.cxx:1912
 TXSocket.cxx:1913
 TXSocket.cxx:1914
 TXSocket.cxx:1915
 TXSocket.cxx:1916
 TXSocket.cxx:1917
 TXSocket.cxx:1918
 TXSocket.cxx:1919
 TXSocket.cxx:1920
 TXSocket.cxx:1921
 TXSocket.cxx:1922
 TXSocket.cxx:1923
 TXSocket.cxx:1924
 TXSocket.cxx:1925
 TXSocket.cxx:1926
 TXSocket.cxx:1927
 TXSocket.cxx:1928
 TXSocket.cxx:1929
 TXSocket.cxx:1930
 TXSocket.cxx:1931
 TXSocket.cxx:1932
 TXSocket.cxx:1933
 TXSocket.cxx:1934
 TXSocket.cxx:1935
 TXSocket.cxx:1936
 TXSocket.cxx:1937
 TXSocket.cxx:1938
 TXSocket.cxx:1939
 TXSocket.cxx:1940
 TXSocket.cxx:1941
 TXSocket.cxx:1942
 TXSocket.cxx:1943
 TXSocket.cxx:1944
 TXSocket.cxx:1945
 TXSocket.cxx:1946
 TXSocket.cxx:1947
 TXSocket.cxx:1948
 TXSocket.cxx:1949
 TXSocket.cxx:1950
 TXSocket.cxx:1951
 TXSocket.cxx:1952
 TXSocket.cxx:1953
 TXSocket.cxx:1954
 TXSocket.cxx:1955
 TXSocket.cxx:1956
 TXSocket.cxx:1957
 TXSocket.cxx:1958
 TXSocket.cxx:1959
 TXSocket.cxx:1960
 TXSocket.cxx:1961
 TXSocket.cxx:1962
 TXSocket.cxx:1963
 TXSocket.cxx:1964
 TXSocket.cxx:1965
 TXSocket.cxx:1966
 TXSocket.cxx:1967
 TXSocket.cxx:1968
 TXSocket.cxx:1969
 TXSocket.cxx:1970
 TXSocket.cxx:1971
 TXSocket.cxx:1972
 TXSocket.cxx:1973
 TXSocket.cxx:1974
 TXSocket.cxx:1975
 TXSocket.cxx:1976
 TXSocket.cxx:1977
 TXSocket.cxx:1978
 TXSocket.cxx:1979
 TXSocket.cxx:1980
 TXSocket.cxx:1981
 TXSocket.cxx:1982
 TXSocket.cxx:1983
 TXSocket.cxx:1984
 TXSocket.cxx:1985
 TXSocket.cxx:1986
 TXSocket.cxx:1987
 TXSocket.cxx:1988
 TXSocket.cxx:1989
 TXSocket.cxx:1990
 TXSocket.cxx:1991
 TXSocket.cxx:1992
 TXSocket.cxx:1993
 TXSocket.cxx:1994
 TXSocket.cxx:1995
 TXSocket.cxx:1996
 TXSocket.cxx:1997
 TXSocket.cxx:1998
 TXSocket.cxx:1999
 TXSocket.cxx:2000
 TXSocket.cxx:2001
 TXSocket.cxx:2002
 TXSocket.cxx:2003
 TXSocket.cxx:2004
 TXSocket.cxx:2005
 TXSocket.cxx:2006
 TXSocket.cxx:2007
 TXSocket.cxx:2008
 TXSocket.cxx:2009
 TXSocket.cxx:2010
 TXSocket.cxx:2011
 TXSocket.cxx:2012
 TXSocket.cxx:2013
 TXSocket.cxx:2014
 TXSocket.cxx:2015
 TXSocket.cxx:2016
 TXSocket.cxx:2017
 TXSocket.cxx:2018
 TXSocket.cxx:2019
 TXSocket.cxx:2020
 TXSocket.cxx:2021
 TXSocket.cxx:2022
 TXSocket.cxx:2023
 TXSocket.cxx:2024
 TXSocket.cxx:2025
 TXSocket.cxx:2026
 TXSocket.cxx:2027
 TXSocket.cxx:2028
 TXSocket.cxx:2029
 TXSocket.cxx:2030
 TXSocket.cxx:2031
 TXSocket.cxx:2032
 TXSocket.cxx:2033
 TXSocket.cxx:2034
 TXSocket.cxx:2035
 TXSocket.cxx:2036
 TXSocket.cxx:2037
 TXSocket.cxx:2038
 TXSocket.cxx:2039
 TXSocket.cxx:2040
 TXSocket.cxx:2041
 TXSocket.cxx:2042
 TXSocket.cxx:2043
 TXSocket.cxx:2044
 TXSocket.cxx:2045
 TXSocket.cxx:2046
 TXSocket.cxx:2047
 TXSocket.cxx:2048
 TXSocket.cxx:2049
 TXSocket.cxx:2050
 TXSocket.cxx:2051
 TXSocket.cxx:2052
 TXSocket.cxx:2053
 TXSocket.cxx:2054
 TXSocket.cxx:2055
 TXSocket.cxx:2056
 TXSocket.cxx:2057
 TXSocket.cxx:2058
 TXSocket.cxx:2059
 TXSocket.cxx:2060
 TXSocket.cxx:2061
 TXSocket.cxx:2062
 TXSocket.cxx:2063
 TXSocket.cxx:2064
 TXSocket.cxx:2065
 TXSocket.cxx:2066
 TXSocket.cxx:2067
 TXSocket.cxx:2068
 TXSocket.cxx:2069
 TXSocket.cxx:2070
 TXSocket.cxx:2071
 TXSocket.cxx:2072
 TXSocket.cxx:2073
 TXSocket.cxx:2074
 TXSocket.cxx:2075
 TXSocket.cxx:2076
 TXSocket.cxx:2077
 TXSocket.cxx:2078
 TXSocket.cxx:2079
 TXSocket.cxx:2080
 TXSocket.cxx:2081
 TXSocket.cxx:2082
 TXSocket.cxx:2083
 TXSocket.cxx:2084
 TXSocket.cxx:2085
 TXSocket.cxx:2086
 TXSocket.cxx:2087
 TXSocket.cxx:2088
 TXSocket.cxx:2089
 TXSocket.cxx:2090
 TXSocket.cxx:2091
 TXSocket.cxx:2092
 TXSocket.cxx:2093
 TXSocket.cxx:2094
 TXSocket.cxx:2095
 TXSocket.cxx:2096
 TXSocket.cxx:2097
 TXSocket.cxx:2098
 TXSocket.cxx:2099
 TXSocket.cxx:2100
 TXSocket.cxx:2101
 TXSocket.cxx:2102
 TXSocket.cxx:2103
 TXSocket.cxx:2104
 TXSocket.cxx:2105
 TXSocket.cxx:2106
 TXSocket.cxx:2107
 TXSocket.cxx:2108
 TXSocket.cxx:2109
 TXSocket.cxx:2110
 TXSocket.cxx:2111
 TXSocket.cxx:2112
 TXSocket.cxx:2113
 TXSocket.cxx:2114
 TXSocket.cxx:2115
 TXSocket.cxx:2116
 TXSocket.cxx:2117
 TXSocket.cxx:2118
 TXSocket.cxx:2119
 TXSocket.cxx:2120
 TXSocket.cxx:2121
 TXSocket.cxx:2122
 TXSocket.cxx:2123
 TXSocket.cxx:2124
 TXSocket.cxx:2125
 TXSocket.cxx:2126
 TXSocket.cxx:2127
 TXSocket.cxx:2128
 TXSocket.cxx:2129
 TXSocket.cxx:2130
 TXSocket.cxx:2131
 TXSocket.cxx:2132
 TXSocket.cxx:2133
 TXSocket.cxx:2134
 TXSocket.cxx:2135
 TXSocket.cxx:2136
 TXSocket.cxx:2137
 TXSocket.cxx:2138
 TXSocket.cxx:2139
 TXSocket.cxx:2140
 TXSocket.cxx:2141
 TXSocket.cxx:2142
 TXSocket.cxx:2143
 TXSocket.cxx:2144
 TXSocket.cxx:2145
 TXSocket.cxx:2146
 TXSocket.cxx:2147
 TXSocket.cxx:2148
 TXSocket.cxx:2149
 TXSocket.cxx:2150
 TXSocket.cxx:2151
 TXSocket.cxx:2152
 TXSocket.cxx:2153
 TXSocket.cxx:2154
 TXSocket.cxx:2155
 TXSocket.cxx:2156
 TXSocket.cxx:2157
 TXSocket.cxx:2158
 TXSocket.cxx:2159
 TXSocket.cxx:2160
 TXSocket.cxx:2161
 TXSocket.cxx:2162
 TXSocket.cxx:2163
 TXSocket.cxx:2164
 TXSocket.cxx:2165
 TXSocket.cxx:2166
 TXSocket.cxx:2167
 TXSocket.cxx:2168
 TXSocket.cxx:2169
 TXSocket.cxx:2170
 TXSocket.cxx:2171
 TXSocket.cxx:2172
 TXSocket.cxx:2173
 TXSocket.cxx:2174
 TXSocket.cxx:2175
 TXSocket.cxx:2176
 TXSocket.cxx:2177
 TXSocket.cxx:2178
 TXSocket.cxx:2179
 TXSocket.cxx:2180
 TXSocket.cxx:2181
 TXSocket.cxx:2182
 TXSocket.cxx:2183
 TXSocket.cxx:2184
 TXSocket.cxx:2185
 TXSocket.cxx:2186
 TXSocket.cxx:2187
 TXSocket.cxx:2188
 TXSocket.cxx:2189
 TXSocket.cxx:2190
 TXSocket.cxx:2191
 TXSocket.cxx:2192
 TXSocket.cxx:2193
 TXSocket.cxx:2194
 TXSocket.cxx:2195
 TXSocket.cxx:2196
 TXSocket.cxx:2197
 TXSocket.cxx:2198
 TXSocket.cxx:2199
 TXSocket.cxx:2200
 TXSocket.cxx:2201
 TXSocket.cxx:2202
 TXSocket.cxx:2203
 TXSocket.cxx:2204
 TXSocket.cxx:2205
 TXSocket.cxx:2206
 TXSocket.cxx:2207
 TXSocket.cxx:2208
 TXSocket.cxx:2209
 TXSocket.cxx:2210
 TXSocket.cxx:2211
 TXSocket.cxx:2212
 TXSocket.cxx:2213
 TXSocket.cxx:2214
 TXSocket.cxx:2215
 TXSocket.cxx:2216
 TXSocket.cxx:2217
 TXSocket.cxx:2218
 TXSocket.cxx:2219
 TXSocket.cxx:2220
 TXSocket.cxx:2221
 TXSocket.cxx:2222
 TXSocket.cxx:2223
 TXSocket.cxx:2224
 TXSocket.cxx:2225
 TXSocket.cxx:2226
 TXSocket.cxx:2227
 TXSocket.cxx:2228
 TXSocket.cxx:2229
 TXSocket.cxx:2230
 TXSocket.cxx:2231
 TXSocket.cxx:2232
 TXSocket.cxx:2233
 TXSocket.cxx:2234
 TXSocket.cxx:2235
 TXSocket.cxx:2236
 TXSocket.cxx:2237
 TXSocket.cxx:2238
 TXSocket.cxx:2239
 TXSocket.cxx:2240
 TXSocket.cxx:2241
 TXSocket.cxx:2242
 TXSocket.cxx:2243
 TXSocket.cxx:2244
 TXSocket.cxx:2245
 TXSocket.cxx:2246
 TXSocket.cxx:2247
 TXSocket.cxx:2248
 TXSocket.cxx:2249
 TXSocket.cxx:2250
 TXSocket.cxx:2251
 TXSocket.cxx:2252
 TXSocket.cxx:2253
 TXSocket.cxx:2254
 TXSocket.cxx:2255
 TXSocket.cxx:2256
 TXSocket.cxx:2257
 TXSocket.cxx:2258
 TXSocket.cxx:2259
 TXSocket.cxx:2260
 TXSocket.cxx:2261
 TXSocket.cxx:2262
 TXSocket.cxx:2263
 TXSocket.cxx:2264
 TXSocket.cxx:2265
 TXSocket.cxx:2266
 TXSocket.cxx:2267
 TXSocket.cxx:2268
 TXSocket.cxx:2269
 TXSocket.cxx:2270
 TXSocket.cxx:2271
 TXSocket.cxx:2272
 TXSocket.cxx:2273
 TXSocket.cxx:2274
 TXSocket.cxx:2275
 TXSocket.cxx:2276
 TXSocket.cxx:2277
 TXSocket.cxx:2278
 TXSocket.cxx:2279
 TXSocket.cxx:2280
 TXSocket.cxx:2281
 TXSocket.cxx:2282
 TXSocket.cxx:2283
 TXSocket.cxx:2284
 TXSocket.cxx:2285
 TXSocket.cxx:2286
 TXSocket.cxx:2287
 TXSocket.cxx:2288
 TXSocket.cxx:2289
 TXSocket.cxx:2290
 TXSocket.cxx:2291
 TXSocket.cxx:2292
 TXSocket.cxx:2293
 TXSocket.cxx:2294
 TXSocket.cxx:2295
 TXSocket.cxx:2296
 TXSocket.cxx:2297
 TXSocket.cxx:2298
 TXSocket.cxx:2299
 TXSocket.cxx:2300
 TXSocket.cxx:2301
 TXSocket.cxx:2302
 TXSocket.cxx:2303
 TXSocket.cxx:2304
 TXSocket.cxx:2305
 TXSocket.cxx:2306
 TXSocket.cxx:2307
 TXSocket.cxx:2308
 TXSocket.cxx:2309
 TXSocket.cxx:2310
 TXSocket.cxx:2311
 TXSocket.cxx:2312
 TXSocket.cxx:2313
 TXSocket.cxx:2314
 TXSocket.cxx:2315
 TXSocket.cxx:2316
 TXSocket.cxx:2317
 TXSocket.cxx:2318
 TXSocket.cxx:2319
 TXSocket.cxx:2320
 TXSocket.cxx:2321
 TXSocket.cxx:2322
 TXSocket.cxx:2323
 TXSocket.cxx:2324
 TXSocket.cxx:2325
 TXSocket.cxx:2326
 TXSocket.cxx:2327
 TXSocket.cxx:2328
 TXSocket.cxx:2329
 TXSocket.cxx:2330
 TXSocket.cxx:2331
 TXSocket.cxx:2332
 TXSocket.cxx:2333
 TXSocket.cxx:2334
 TXSocket.cxx:2335
 TXSocket.cxx:2336
 TXSocket.cxx:2337
 TXSocket.cxx:2338
 TXSocket.cxx:2339
 TXSocket.cxx:2340
 TXSocket.cxx:2341
 TXSocket.cxx:2342
 TXSocket.cxx:2343
 TXSocket.cxx:2344
 TXSocket.cxx:2345
 TXSocket.cxx:2346
 TXSocket.cxx:2347
 TXSocket.cxx:2348
 TXSocket.cxx:2349
 TXSocket.cxx:2350