XmlRpcSocket.h
Go to the documentation of this file.00001 #ifndef _XMLRPCSOCKET_H_
00002 #define _XMLRPCSOCKET_H_
00003
00004
00005
00006
00012 #if defined(_MSC_VER)
00013 # pragma warning(disable:4786) // identifier was truncated in debug info
00014 #endif
00015
00016 #ifndef MAKEDEPEND
00017 # include <string>
00018 #endif
00019
00020 #ifdef USE_SSL
00021 #include <openssl/ssl.h>
00022 #else
00023 #define SSL void*
00024 #define SSL_read void*
00025 #define SSL_write void*
00026 #endif
00027
00028 namespace XmlRpc {
00029
00031 class XmlRpcSocket {
00032 public:
00033
00034
00036 static int getSocket();
00037
00039 static void close(int socket);
00040
00041
00043 static bool setNonBlocking(int socket);
00044
00046 static bool nbRead(int socket, std::string& s, bool *eof, SSL *ssl);
00047
00049 static bool nbWrite(int socket, std::string& s, int *bytesSoFar, SSL* ssl);
00050
00051
00052
00053
00056 static bool setReuseAddr(int socket);
00057
00059 static bool bind(int socket, int port);
00060
00062 static bool listen(int socket, int backlog);
00063
00065 static int accept(int socket);
00066
00068 static bool connect(int socket, std::string& host, int port);
00069
00071 static int getPort(int socket);
00072
00074 static bool nonFatalError();
00075
00077 static int getError();
00078
00080 static std::string getErrorMsg();
00081
00083 static std::string getErrorMsg(int error);
00084 };
00085
00086 }
00087
00088 #endif