Changeset 14 in libcf++ for trunk/src/network.cpp
- Timestamp:
- 06/13/15 18:44:16 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/network.cpp
r13 r14 155 155 cf::bool_t cf::network::host::empty() const 156 156 { 157 return (address().empty() || port() <= 0) ? true : false;157 return (address().empty() || port() == 0) ? true : false; 158 158 } 159 159 … … 209 209 throw (cf::exception) 210 210 { 211 if (peer.empty()) 212 THROW_EXCEPTION("invalid host info"); 213 211 connect(peer.address(), peer.port(), timeout); 212 } 213 214 cf::void_t cf::network::tcp::connect(const std::string & address, 215 const cf::uint16_t port, 216 const cf::int32_t timeout) 217 throw (cf::exception) 218 { 214 219 cf::int32_t result = 0; 215 220 cf::int32_t retval = 0; … … 218 223 struct hostent * hostEnt; 219 224 220 const cf::char_t * host = peer.address().c_str(); 221 cf::uint16_t port = peer.port(); 225 const cf::char_t * host = address.c_str(); 222 226 223 227 /* 1. set data */ … … 353 357 cf::int32_t size = static_cast<cf::int32_t>(in.size()); 354 358 355 cf::int32_t sentSize = (cf::int32_t)::send 359 cf::int32_t sentSize = (cf::int32_t)::send(mSocket, buf, size, 0); 356 360 if (sentSize != size) 357 361 THROW_EXCEPTION("cannot send (" << cf::exception::systemCode() << ")");
Note:
See TracChangeset
for help on using the changeset viewer.