aboutsummaryrefslogtreecommitdiffstats
path: root/vmime
diff options
context:
space:
mode:
Diffstat (limited to 'vmime')
-rw-r--r--vmime/net/imap/IMAPServiceInfos.hpp1
-rw-r--r--vmime/net/pop3/POP3ServiceInfos.hpp1
-rw-r--r--vmime/net/service.hpp17
-rw-r--r--vmime/net/serviceInfos.hpp5
-rw-r--r--vmime/net/smtp/SMTPServiceInfos.hpp1
-rw-r--r--vmime/net/socket.hpp2
-rw-r--r--vmime/net/timeoutHandler.hpp2
-rw-r--r--vmime/platformDependant.hpp12
-rw-r--r--vmime/platforms/posix/posixHandler.hpp4
-rw-r--r--vmime/platforms/windows/windowsHandler.hpp4
10 files changed, 26 insertions, 23 deletions
diff --git a/vmime/net/imap/IMAPServiceInfos.hpp b/vmime/net/imap/IMAPServiceInfos.hpp
index 67ef0980..0b66bd0e 100644
--- a/vmime/net/imap/IMAPServiceInfos.hpp
+++ b/vmime/net/imap/IMAPServiceInfos.hpp
@@ -62,7 +62,6 @@ public:
serviceInfos::property PROPERTY_SERVER_ADDRESS;
serviceInfos::property PROPERTY_SERVER_PORT;
- serviceInfos::property PROPERTY_SERVER_SOCKETFACTORY;
serviceInfos::property PROPERTY_TIMEOUT_FACTORY;
};
diff --git a/vmime/net/pop3/POP3ServiceInfos.hpp b/vmime/net/pop3/POP3ServiceInfos.hpp
index 04f14b78..b2c668cb 100644
--- a/vmime/net/pop3/POP3ServiceInfos.hpp
+++ b/vmime/net/pop3/POP3ServiceInfos.hpp
@@ -64,7 +64,6 @@ public:
serviceInfos::property PROPERTY_SERVER_ADDRESS;
serviceInfos::property PROPERTY_SERVER_PORT;
- serviceInfos::property PROPERTY_SERVER_SOCKETFACTORY;
serviceInfos::property PROPERTY_TIMEOUT_FACTORY;
};
diff --git a/vmime/net/service.hpp b/vmime/net/service.hpp
index 8025ebd9..5a03b789 100644
--- a/vmime/net/service.hpp
+++ b/vmime/net/service.hpp
@@ -33,6 +33,8 @@
#include "vmime/net/serviceFactory.hpp"
#include "vmime/net/serviceInfos.hpp"
+#include "vmime/net/socket.hpp"
+
#if VMIME_HAVE_TLS_SUPPORT
#include "vmime/net/tls/certificateVerifier.hpp"
#endif // VMIME_HAVE_TLS_SUPPORT
@@ -146,6 +148,20 @@ public:
#endif // VMIME_HAVE_TLS_SUPPORT
+ /** Set the factory used to create socket objects for this
+ * service.
+ *
+ * @param sf socket factory
+ */
+ void setSocketFactory(ref <socketFactory> sf);
+
+ /** Return the factory used to create socket objects for this
+ * service.
+ *
+ * @return socket factory
+ */
+ ref <socketFactory> getSocketFactory();
+
/** Set a property for this service (service prefix is added automatically).
*
* WARNING: this sets the property on the session object, so all service
@@ -184,6 +200,7 @@ private:
ref <tls::certificateVerifier> m_certVerifier;
#endif // VMIME_HAVE_TLS_SUPPORT
+ ref <socketFactory> m_socketFactory;
};
diff --git a/vmime/net/serviceInfos.hpp b/vmime/net/serviceInfos.hpp
index 14657b2b..f913f838 100644
--- a/vmime/net/serviceInfos.hpp
+++ b/vmime/net/serviceInfos.hpp
@@ -76,11 +76,6 @@ public:
* maildir, this is the local filesystem directory). */
static const property SERVER_ROOTPATH;
- /** The common property 'server.socket-factory' used
- * to indicate which factory to use to instanciate
- * new socket objects. */
- static const property SERVER_SOCKETFACTORY;
-
/** The common property 'auth.username' which is the
* username used to authenticate with the server. */
static const property AUTH_USERNAME;
diff --git a/vmime/net/smtp/SMTPServiceInfos.hpp b/vmime/net/smtp/SMTPServiceInfos.hpp
index ac3ae372..dcdef9f9 100644
--- a/vmime/net/smtp/SMTPServiceInfos.hpp
+++ b/vmime/net/smtp/SMTPServiceInfos.hpp
@@ -63,7 +63,6 @@ public:
serviceInfos::property PROPERTY_SERVER_ADDRESS;
serviceInfos::property PROPERTY_SERVER_PORT;
- serviceInfos::property PROPERTY_SERVER_SOCKETFACTORY;
serviceInfos::property PROPERTY_TIMEOUT_FACTORY;
};
diff --git a/vmime/net/socket.hpp b/vmime/net/socket.hpp
index 1d61e0dc..a0c2608c 100644
--- a/vmime/net/socket.hpp
+++ b/vmime/net/socket.hpp
@@ -99,7 +99,7 @@ private:
/** A class to create 'socket' objects.
*/
-class socketFactory
+class socketFactory : public object
{
public:
diff --git a/vmime/net/timeoutHandler.hpp b/vmime/net/timeoutHandler.hpp
index 5f8bcc59..ae43a9de 100644
--- a/vmime/net/timeoutHandler.hpp
+++ b/vmime/net/timeoutHandler.hpp
@@ -64,7 +64,7 @@ public:
/** A class to create 'timeoutHandler' objects.
*/
-class timeoutHandlerFactory
+class timeoutHandlerFactory : public object
{
public:
diff --git a/vmime/platformDependant.hpp b/vmime/platformDependant.hpp
index a09161ef..17a2656b 100644
--- a/vmime/platformDependant.hpp
+++ b/vmime/platformDependant.hpp
@@ -103,18 +103,12 @@ public:
virtual void wait() const = 0;
#if VMIME_HAVE_MESSAGING_FEATURES
- /** Return a pointer to a socket factory for the specified socket
- * type name (this is user-defined, and used for example when you
- * want to set up a SSL connection to a server).
- * The returned object will not be deleted by VMime, so it can be
- * a pointer to a static object.
+ /** Return a pointer to the default socket factory for
+ * this platform.
*
- * @param name socket type name (user-dependant): this is usually
- * the value of the property "server.socket-factory" set in the
- * session object
* @return socket factory
*/
- virtual net::socketFactory* getSocketFactory(const string& name = "default") const = 0;
+ virtual ref <net::socketFactory> getSocketFactory() const = 0;
/** Return a pointer to a timeout-handler factory for the specified name.
* The returned object will not be deleted by VMime, so it can be a
diff --git a/vmime/platforms/posix/posixHandler.hpp b/vmime/platforms/posix/posixHandler.hpp
index bb8ef359..d5ba1826 100644
--- a/vmime/platforms/posix/posixHandler.hpp
+++ b/vmime/platforms/posix/posixHandler.hpp
@@ -61,7 +61,7 @@ public:
const unsigned int getProcessId() const;
#if VMIME_HAVE_MESSAGING_FEATURES
- vmime::net::socketFactory* getSocketFactory(const vmime::string& name) const;
+ ref <vmime::net::socketFactory> getSocketFactory() const;
vmime::net::timeoutHandlerFactory* getTimeoutHandlerFactory(const vmime::string& name) const;
#endif
@@ -77,7 +77,7 @@ public:
private:
#if VMIME_HAVE_MESSAGING_FEATURES
- posixSocketFactory* m_socketFactory;
+ ref <posixSocketFactory> m_socketFactory;
#endif
#if VMIME_HAVE_FILESYSTEM_FEATURES
diff --git a/vmime/platforms/windows/windowsHandler.hpp b/vmime/platforms/windows/windowsHandler.hpp
index df2cb6c0..4a94628f 100644
--- a/vmime/platforms/windows/windowsHandler.hpp
+++ b/vmime/platforms/windows/windowsHandler.hpp
@@ -60,7 +60,7 @@ public:
const unsigned int getProcessId() const;
#if VMIME_HAVE_MESSAGING_FEATURES
- vmime::net::socketFactory* getSocketFactory(const vmime::string& name) const;
+ ref <vmime::net::socketFactory> getSocketFactory() const;
vmime::net::timeoutHandlerFactory* getTimeoutHandlerFactory(const vmime::string& name) const;
#endif
@@ -76,7 +76,7 @@ public:
private:
#if VMIME_HAVE_MESSAGING_FEATURES
- windowsSocketFactory* m_socketFactory;
+ ref <windowsSocketFactory> m_socketFactory;
#endif
#if VMIME_HAVE_FILESYSTEM_FEATURES