Changeset 9432 for trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc
- Timestamp:
- 04/22/09 10:46:59 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Cosy/tcpip/MTcpIpIO.cc
r8869 r9432 15 15 16 16 #undef DEBUG 17 //#define DEBUG 17 18 18 19 using namespace std; … … 40 41 */ 41 42 42 MTcpIpO::MTcpIpO(const char *addr, Int_t tx) 43 { 43 MTcpIpO::MTcpIpO(const char *addr, Int_t tx) : fPortTx(tx) 44 { 45 gLog << inf2 << "- Open send socket to " << addr << ":" << tx << endl; 44 46 fTxSocket = new TSocket(addr, tx); 45 47 } … … 147 149 bool MTcpIpO::Send(const char *msg, Int_t len) 148 150 { 151 if (!fTxSocket->IsValid()) 152 { 153 const TInetAddress &a = fTxSocket->GetInetAddress(); 154 if (!a.IsValid()) 155 return false; 156 #ifdef DEBUG 157 cout << "- Reopen send socket to " << a.GetHostAddress() << ":" << fPortTx << endl; 158 #endif 159 delete fTxSocket; 160 fTxSocket = new TSocket(a.GetHostAddress(), fPortTx); 161 } 162 149 163 return SendFrame(*fTxSocket, msg, len); 150 164 } … … 206 220 fConnectionEstablished = kTRUE; 207 221 208 MTimeout timeout ;222 MTimeout timeout(fTimeout); 209 223 210 224 // Get connection on port fPortRx and redirected … … 228 242 if (timeout.HasTimedOut()) 229 243 { 230 gLog << warn << MTime(-1) << " WARNING - Connection to " << MTcpIpO::GetSocketAddress(sock) << " timed out ." << endl;244 gLog << warn << MTime(-1) << " WARNING - Connection to " << MTcpIpO::GetSocketAddress(sock) << " timed out after " << fTimeout << "ms." << endl; 231 245 return kFALSE; 232 246 } … … 285 299 fConnectionEstablished = kFALSE; 286 300 301 #ifdef DEBUG 302 cout << "===> DEL SOCKET" << endl; 303 #endif 287 304 delete socket; 288 305 } … … 314 331 } 315 332 333 #ifdef DEBUG 334 cout << "===> DEL SERVER" << endl; 335 #endif 316 336 delete server; 317 337
Note:
See TracChangeset
for help on using the changeset viewer.