diff options
author | Alan Conway <aconway@apache.org> | 2006-11-13 19:28:23 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2006-11-13 19:28:23 +0000 |
commit | 922d1249a1a48c13a2e37f1efc1b3204ca5e9813 (patch) | |
tree | 0a5284b22967b19a97d02284d3bafe2ae9d79df0 /cpp/src/qpid/posix/Socket.cpp | |
parent | fc5ad32cc8f2d4d793c0cf79382755e9fca2357c (diff) | |
download | qpid-python-922d1249a1a48c13a2e37f1efc1b3204ca5e9813.tar.gz |
EventChannel classes, start of epoll-based posix implementation.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@474452 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/posix/Socket.cpp')
-rw-r--r-- | cpp/src/qpid/posix/Socket.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cpp/src/qpid/posix/Socket.cpp b/cpp/src/qpid/posix/Socket.cpp index 3101be54f4..1321ae6b0d 100644 --- a/cpp/src/qpid/posix/Socket.cpp +++ b/cpp/src/qpid/posix/Socket.cpp @@ -33,7 +33,7 @@ using namespace qpid::sys; Socket::Socket() : socket(::socket (PF_INET, SOCK_STREAM, 0)) { - if (socket == 0) CHECK(-1); + CHECKNN(socket == 0); } void @@ -53,16 +53,16 @@ Socket::connect(const std::string& host, int port) name.sin_family = AF_INET; name.sin_port = htons(port); struct hostent* hp = gethostbyname ( host.c_str() ); - if (hp == 0) CHECK(-1); // TODO aconway 2006-11-09: error message? + if (hp == 0) CHECK0(-1); // TODO aconway 2006-11-09: error message? memcpy(&name.sin_addr.s_addr, hp->h_addr_list[0], hp->h_length); - CHECK(::connect(socket, (struct sockaddr*)(&name), sizeof(name))); + CHECK0(::connect(socket, (struct sockaddr*)(&name), sizeof(name))); } void Socket::close() { if (socket == 0) return; - CHECK(::close(socket)); + CHECK0(::close(socket)); socket = 0; } @@ -73,7 +73,7 @@ Socket::send(const char* data, size_t size) if (sent < 0) { if (errno == ECONNRESET) return SOCKET_EOF; if (errno == ETIMEDOUT) return SOCKET_TIMEOUT; - CHECK(sent); + CHECK0(sent); } return sent; } @@ -84,7 +84,7 @@ Socket::recv(char* data, size_t size) ssize_t received = ::recv(socket, data, size, 0); if (received < 0) { if (errno == ETIMEDOUT) return SOCKET_TIMEOUT; - CHECK(received); + CHECK0(received); } return received; } |