version 1.37, 2008/12/02 09:00:52
|
version 1.38, 2009/02/05 08:13:21
|
|
|
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include <Pegasus/Common/Threads.h> | #include <Pegasus/Common/Threads.h> |
|
#include <Pegasus/Common/Mutex.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
#ifdef PEGASUS_OS_TYPE_WINDOWS |
static Uint32 _socketInterfaceRefCount = 0; | static Uint32 _socketInterfaceRefCount = 0; |
|
static Mutex _socketInterfaceRefCountLock; |
|
#endif |
| |
Boolean Socket::timedConnect( | Boolean Socket::timedConnect( |
SocketHandle socket, | SocketHandle socket, |
|
|
void Socket::initializeInterface() | void Socket::initializeInterface() |
{ | { |
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
|
AutoMutex mtx(_socketInterfaceRefCountLock); |
if (_socketInterfaceRefCount == 0) | if (_socketInterfaceRefCount == 0) |
{ | { |
WSADATA tmp; | WSADATA tmp; |
|
|
void Socket::uninitializeInterface() | void Socket::uninitializeInterface() |
{ | { |
#ifdef PEGASUS_OS_TYPE_WINDOWS | #ifdef PEGASUS_OS_TYPE_WINDOWS |
|
AutoMutex mtx(_socketInterfaceRefCountLock); |
_socketInterfaceRefCount--; | _socketInterfaceRefCount--; |
| |
if (_socketInterfaceRefCount == 0) | if (_socketInterfaceRefCount == 0) |