summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2009-01-03 08:56:13 +0000
committerChris Wilson <chris+github@qwirx.com>2009-01-03 08:56:13 +0000
commitf5257ef4a8f2b9e2edb944a497e37f78a22fea44 (patch)
tree37e44509756ab5a961897aa9de7b53d07bad1b21
parent3d7966138559f727a03a4b7c901508654125b7cf (diff)
Change use of int to identify a socket type to the proper enum.
-rw-r--r--lib/server/Socket.cpp6
-rw-r--r--lib/server/Socket.h4
-rw-r--r--lib/server/SocketListen.h2
-rw-r--r--lib/server/SocketStream.h3
-rw-r--r--lib/server/SocketStreamTLS.cpp2
5 files changed, 10 insertions, 7 deletions
diff --git a/lib/server/Socket.cpp b/lib/server/Socket.cpp
index 72c126a8..4a83bdb0 100644
--- a/lib/server/Socket.cpp
+++ b/lib/server/Socket.cpp
@@ -32,13 +32,15 @@
// --------------------------------------------------------------------------
//
// Function
-// Name: Socket::NameLookupToSockAddr(SocketAllAddr &, int, char *, int)
+// Name: Socket::NameLookupToSockAddr(SocketAllAddr &, int,
+// char *, int)
// Purpose: Sets up a sockaddr structure given a name and type
// Created: 2003/07/31
//
// --------------------------------------------------------------------------
void Socket::NameLookupToSockAddr(SocketAllAddr &addr, int &sockDomain,
- int Type, const std::string& rName, int Port, int &rSockAddrLenOut)
+ enum Type Type, const std::string& rName, int Port,
+ int &rSockAddrLenOut)
{
int sockAddrLen = 0;
diff --git a/lib/server/Socket.h b/lib/server/Socket.h
index dcbac8c5..5034dbd8 100644
--- a/lib/server/Socket.h
+++ b/lib/server/Socket.h
@@ -39,14 +39,14 @@ typedef union {
// --------------------------------------------------------------------------
namespace Socket
{
- enum
+ enum Type
{
TypeINET = 1,
TypeUNIX = 2
};
void NameLookupToSockAddr(SocketAllAddr &addr, int &sockDomain,
- int Type, const std::string& rName, int Port,
+ enum Type type, const std::string& rName, int Port,
int &rSockAddrLenOut);
void LogIncomingConnection(const struct sockaddr *addr, socklen_t addrlen);
std::string IncomingConnectionLogMessage(const struct sockaddr *addr, socklen_t addrlen);
diff --git a/lib/server/SocketListen.h b/lib/server/SocketListen.h
index 1cfce648..586adf22 100644
--- a/lib/server/SocketListen.h
+++ b/lib/server/SocketListen.h
@@ -125,7 +125,7 @@ public:
// Created: 2003/07/31
//
// ------------------------------------------------------------------
- void Listen(int Type, const char *Name, int Port = 0)
+ void Listen(Socket::Type Type, const char *Name, int Port = 0)
{
if(mSocketHandle != -1)
{
diff --git a/lib/server/SocketStream.h b/lib/server/SocketStream.h
index fa81cfd9..2b582f21 100644
--- a/lib/server/SocketStream.h
+++ b/lib/server/SocketStream.h
@@ -11,6 +11,7 @@
#define SOCKETSTREAM__H
#include "IOStream.h"
+#include "Socket.h"
#ifdef WIN32
typedef SOCKET tOSSocketHandle;
@@ -36,7 +37,7 @@ public:
SocketStream(const SocketStream &rToCopy);
~SocketStream();
- void Open(int Type, const std::string& rName, int Port = 0);
+ void Open(Socket::Type Type, const std::string& rName, int Port = 0);
void Attach(int socket);
virtual int Read(void *pBuffer, int NBytes, int Timeout = IOStream::TimeOutInfinite);
diff --git a/lib/server/SocketStreamTLS.cpp b/lib/server/SocketStreamTLS.cpp
index 979aee9b..19fdadd4 100644
--- a/lib/server/SocketStreamTLS.cpp
+++ b/lib/server/SocketStreamTLS.cpp
@@ -99,7 +99,7 @@ SocketStreamTLS::~SocketStreamTLS()
// Created: 2003/08/06
//
// --------------------------------------------------------------------------
-void SocketStreamTLS::Open(const TLSContext &rContext, int Type,
+void SocketStreamTLS::Open(const TLSContext &rContext, Socket::Type Type,
const std::string& rName, int Port)
{
SocketStream::Open(Type, rName, Port);