diff options
| author | Kim van der Riet <kpvdr@apache.org> | 2012-08-03 12:13:32 +0000 |
|---|---|---|
| committer | Kim van der Riet <kpvdr@apache.org> | 2012-08-03 12:13:32 +0000 |
| commit | d43d1912b376322e27fdcda551a73f9ff5487972 (patch) | |
| tree | ce493e10baa95f44be8beb5778ce51783463196d /cpp/src/qpid/sys/windows | |
| parent | 04877fec0c6346edec67072d7f2d247740cf2af5 (diff) | |
| download | qpid-python-d43d1912b376322e27fdcda551a73f9ff5487972.tar.gz | |
QPID-3858: Updated branch - merged from trunk r.1368650
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1368910 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/windows')
| -rwxr-xr-x | cpp/src/qpid/sys/windows/IocpPoller.cpp | 5 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/windows/MemStat.cpp | 29 | ||||
| -rw-r--r-- | cpp/src/qpid/sys/windows/Socket.cpp | 17 | ||||
| -rwxr-xr-x | cpp/src/qpid/sys/windows/SystemInfo.cpp | 10 |
4 files changed, 22 insertions, 39 deletions
diff --git a/cpp/src/qpid/sys/windows/IocpPoller.cpp b/cpp/src/qpid/sys/windows/IocpPoller.cpp index 1805dd2cd8..c81cef87b0 100755 --- a/cpp/src/qpid/sys/windows/IocpPoller.cpp +++ b/cpp/src/qpid/sys/windows/IocpPoller.cpp @@ -96,6 +96,7 @@ void Poller::shutdown() { // Allow sloppy code to shut us down more than once. if (impl->isShutdown) return; + impl->isShutdown = true; ULONG_PTR key = 1; // Tell wait() it's a shutdown, not I/O PostQueuedCompletionStatus(impl->iocp, 0, key, 0); } @@ -110,7 +111,7 @@ bool Poller::interrupt(PollerHandle&) { } void Poller::run() { - do { + while (!impl->isShutdown) { Poller::Event event = this->wait(); // Handle shutdown @@ -124,7 +125,7 @@ void Poller::run() { // This should be impossible assert(false); } - } while (true); + } } void Poller::monitorHandle(PollerHandle& handle, Direction dir) { diff --git a/cpp/src/qpid/sys/windows/MemStat.cpp b/cpp/src/qpid/sys/windows/MemStat.cpp deleted file mode 100644 index b1d25c5fc5..0000000000 --- a/cpp/src/qpid/sys/windows/MemStat.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -#include "qpid/sys/MemStat.h" - -void qpid::sys::MemStat::loadMemInfo(qmf::org::apache::qpid::broker::Memory*) -{ - // TODO: Add Windows-specific memory stats to the object and load them here. -} - - diff --git a/cpp/src/qpid/sys/windows/Socket.cpp b/cpp/src/qpid/sys/windows/Socket.cpp index b085f67539..a4374260cc 100644 --- a/cpp/src/qpid/sys/windows/Socket.cpp +++ b/cpp/src/qpid/sys/windows/Socket.cpp @@ -266,14 +266,17 @@ int Socket::getError() const void Socket::setTcpNoDelay() const { - int flag = 1; - int result = setsockopt(impl->fd, - IPPROTO_TCP, - TCP_NODELAY, - (char *)&flag, - sizeof(flag)); - QPID_WINSOCK_CHECK(result); + SOCKET& socket = impl->fd; nodelay = true; + if (socket != INVALID_SOCKET) { + int flag = 1; + int result = setsockopt(impl->fd, + IPPROTO_TCP, + TCP_NODELAY, + (char *)&flag, + sizeof(flag)); + QPID_WINSOCK_CHECK(result); + } } inline IOHandlePrivate* IOHandlePrivate::getImpl(const qpid::sys::IOHandle &h) diff --git a/cpp/src/qpid/sys/windows/SystemInfo.cpp b/cpp/src/qpid/sys/windows/SystemInfo.cpp index 4da440bdd4..cef78dcc60 100755 --- a/cpp/src/qpid/sys/windows/SystemInfo.cpp +++ b/cpp/src/qpid/sys/windows/SystemInfo.cpp @@ -23,9 +23,11 @@ # define _WIN32_WINNT 0x0501 #endif -#include "qpid/sys/IntegerTypes.h" #include "qpid/sys/SystemInfo.h" +#include "qpid/sys/IntegerTypes.h" +#include "qpid/Exception.h"
+#include <assert.h> #include <winsock2.h> #include <ws2tcpip.h> #include <windows.h> @@ -93,6 +95,12 @@ void SystemInfo::getLocalIpAddresses (uint16_t port, } } +bool SystemInfo::isLocalHost(const std::string& candidateHost) { + // FIXME aconway 2012-05-03: not implemented. + assert(0); + throw Exception("Not implemented: isLocalHost"); +} + void SystemInfo::getSystemId (std::string &osName, std::string &nodeName, std::string &release, |
